3 ms·
Better yet, in this particular case, don't use the builder pattern, and instead just provide a sensible set of constructors with appropriate defaults for unspec
by jasomill 3y ago
Better yet, in this particular case, don't use the builder pattern, and instead just provide a sensible set of constructors with appropriate defaults for unspecified arguments (e.g., 00:00 for unspecified time).
For a simple date/time class, the builder pattern reeks of pointless overengineering.
- magicalhippo 3y agoOh certainly, didn't mean to imply it's great for a freaking date. But I've seen the mutating pattern in other cases causing the weird state bug which could have avoided using a builder.