3 ms·
> Are there better ways It's a question of taste, but the builder pattern can be considered a “better way”, because of how clunky the use of Default can be. Y
by Narann 5y ago
> Are there better ways
It's a question of taste, but the builder pattern can be considered a “better way”, because of how clunky the use of Default can be.
You would prefer an API with easier to read, documented builders than the ..Default::default() call.
- davidkunz 5y agoWhat I dislike about the builder pattern is that it treats input not as one 'blob' of data and thus makes simple things more complicated.
- Narann 5y agoI have the same feeling. I would love to know if a builder object can be zero cost and if it could actually write assembly code the same way as if we would have passed those arguments manually.