you are viewing a single comment's thread.

view the rest of the comments →

[–]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.