Hacker News new | ask | show | jobs
by Arwill 4575 days ago
In the real world, these (and other) programming principles are abused to no end. OOP is used blindly as some kind of magic that is expected to produce a good system by itself. More objects, more abstraction is not always good. What will you do when you need to debug trough 5 levels of abstraction meaning 37 levels of subroutine calls just to reach the critical code? What will you do when some guy encapsulates his code in i class as into a black box, but then leaves the company, leaving the class unmaintained? You will still need to deal with it, you will still need to debug through it. And the added levels of abstraction will make it more uncertain where the problem lies. As i've seen recently on a project, the blind enforcing of various OOP principles was responsible for the messy code, i would say 90% of code was in-house made framework/boilerplate, and the important parts were scattered around that. I'm only fan of one programming principle, and that's KISS. Or more precisely i believe that: when you can express something with the programming language directly, don't build abstractions on top of the language to express that thing. When someone else looks at your code, he will only need to know the programming language and read the code, and he will need to learn less about your custom abstractions.