3 ms·
For this example, builder pattern is definitely overkill, but builders can be still useful for more complex cases. Even for simple structs, sometimes you don't
by ungzd 8y ago
For this example, builder pattern is definitely overkill, but builders can be still useful for more complex cases. Even for simple structs, sometimes you don't want to expose constructor, for example to add additional checks ("smart constructors" in Haskell jargon).