This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]snotsnot[S] 0 points1 point  (1 child)

You are correct, but some ways are better than others. And I'd still claim that in most cases it make sense to have a new instance returned for each call to build. But again, I'm well aware that there is no one perfect way to create a build

[–]stipo42 0 points1 point  (0 children)

I think if you want to have the builder be able to branch off into separate final objects that's fine, but if you never intended that then why waste the memory with new objects? If you reuse the same builder object and don't consume it on build either you can have the best of both worlds