2 ms·
A class with just data is not an object, it's a structure. Inheritance and encapsulation are bad. I fail to see any pro for OOP even if I use it every day. O
by DeathArrow 4y ago
A class with just data is not an object, it's a structure.
Inheritance and encapsulation are bad.
I fail to see any pro for OOP even if I use it every day.
OOP, "clean coding", design patterns and TDD morphed most code bases into monstrosities, hard to reason about, inneficient, hard to change and slow - even if they promised the opposite.
I find good old procedural programming and functional programming more fun.
- wsc981 4y agoWhile I submitted this article, cause it raises some interesting points, I still do pretty much all of my programming in object oriented style. But for my next project I want to try the procedural approach. With that said, I've always believed that just a single level of inheritance can be quite useful (e.g. abstract base class and below that the concrete classes). However, adding more levels of concrete classes below this can get confusing. Perhaps there should be some way in programming languages to restrict subclassing to a single level only, perhaps that could be useful. It's kinda funny that when I started programming, so many years ago, I only did procedural programming (TI-BASIC on the TI-99/4A). But after programming object oriented for so many years, it feels kinda hard to make the switch back to procedural style. I do find my Lua / LÖVE 2D programs become much harder to reason about as the codebase grows and I am kinda hoping adopting a procedural style can fix this issue. Though I do know part of the issue is that Lua is not static typed.