Jonathan Gros-Dubois
1 min readFeb 11, 2022

--

All of the criticisms in this article are not about OOP, but rather about some anti-patterns and ways in which people misuse OOP.

You could make such arguments about anything. For example, I've observed that FP code often lacks proper separation of concerns between different modules/components and it makes it difficult to read and maintain the code, this doesn't necessarily mean there is a problem with FP itself... Any paradigm can be misused.

It's an anti-pattern to pass a single instance reference to multiple objects at the same time. You want loose coupling and high cohesion. If your class method requires a complex instance to be passed in as an argument; this creates a tight coupling because a complex interface makes the class more difficult to substitute in the future. Also, if you have two objects operating on the same external instance at the same time, this suggests low cohesion (poor separation of responsibilities). It's a design flaw, not a flaw in OOP itself.

--

--

No responses yet