I don't use "naked" object construction syntax much. For any nontrivial object 
type I write a `new` or `init` function that wraps it, and then call that 
elsewhere.

I come from a C++ / Objective-C / Smalltalk background, where the general rule 
is that an object's fields should be private. Centralizing initialization gives 
you more control, e.g. if a field always needs to be initialized with a 
specific or computed value.

(By "nontrivial", I mean objects that have their own logic and aren't just 
passive containers.)

Reply via email to