6 ms·
In small doses, OOP is invaluable, especially for defining modules and their interfaces. Alas, OOP advocates, especially in the old days, oversold it. Several m
by alquemist 6y ago
In small doses, OOP is invaluable, especially for defining modules and their interfaces. Alas, OOP advocates, especially in the old days, oversold it. Several major flaws:
* "Everything is an object". This creates unnecessary confusion between data and modules and sometimes even functions.
* "Everything is a message". This encourages splitting state between a myriad of objects, each hiding some tiny bit of mutable state that changes whenever it receives a message. Reasoning about such a state graph is impossible for any non-trivial application.
* "Everything is an interface", which leads to tests tightly coupled to implementation due to mock over-usage.
* "Everything is an inheritance hierarchy". Practice has proven that composition is better than inheritance.
- kazinator 6y agoNo, no, no. Everything is a pointer-wide cell of bits, with a type tag. Now we're cooking with gas!