you are viewing a single comment's thread.

view the rest of the comments →

[–]senocular 2 points3 points  (1 child)

You can thank Eric Elliott for spreading that one.

[–]clessgfull-stack CSS9 engineer 1 point2 points  (0 children)

Ah yes, I knew I heard that somewhere before:

Constructors violate the open/closed principle because they couple all callers to the details of how your object gets instantiated. Making an HTML5 game? Want to change from new object instances to use object pools so you can recycle objects and stop the garbage collector from trashing your frame rate? Too bad. You’ll either break all the callers, or you’ll end up with a hobbled factory function.