News for hackers. Stuff that matters.
Re:Jiff: A brand new Datetime library for Rust, from the aut... by estebank on Tuesday July 23, 2024 @12:21PM (#41047784)
The issue I have with Default is that the verbosity jump from derive(Default) to impl Default for Type is high, evej if you just want to specify a single field. The other reason I want this is because it makes defining builders almost trivial for any case where custom logic isn't needed for the fields. I would expect the impl-based builder pattern to become more niche if we had this feature. Your reason is yet another that would be nice to address as well. I like how this one change addresses multiple things at once.
Re:Jiff: A brand new Datetime library for Rust, from the aut... by steveklabnik on Tuesday July 23, 2024 @01:12PM (#41048460)
Yeah, full agreement here. I almost said something along the lines of "it's almost like extending #[derive(Default)] with serde-like attributes to control which fields get what defaults, but with nicer syntax," but got a little lazy with it since we're in agreement anyway. It is annoying that deriving Default is all or nothing.

I didn't even think about the builder thing, but you're right there too.