4 ms·
"Don't do work in the constructor" is an OOP principle that must be decades old. The problem with Python and Ruby is that being dynamic it makes them real easy
by lamontcg 5y ago
"Don't do work in the constructor" is an OOP principle that must be decades old.
The problem with Python and Ruby is that being dynamic it makes them real easy to do highly lightweight OOP. There's just a cultural disconnect in the OO world where once you get past objects wrapping data the design patterns tend to come from the Java world and quickly descend into explaining dependency injection containers that nobody uses in Python or Ruby. There's a bit of a cultural middle ground which is not well defined due to the history of how it all evolved.