#Constructors
2 notas · última:
Constructors or Static Factory Methods?
The page argues that static factory methods only look better when the design is already wrong. It favors constructors, polymorphism, and separate objects over static creation helpers.
Object Validation: to Defer or Not?
The article distinguishes constructor checks that protect object state from later checks that affect runtime behavior. Nil and wrong-type arguments belong in the constructor; file existence and file kind belong in the method.
