OOP sucks

This is your brain on OOP

Sorry, somebody needs to say this out loud, if not for any other reasons than to balance the debate. When I say OOP though, I don’t actually mean OOP. I mean the way it has been traditionally implemented, in languages such as C++, C#, etc. And facts of the matter is, that this way of thinking about object oriented programming seriously sucks!

First of all, it puts your mind into a rigid mindset where everything needs to be classified in order to have function. Secondly, it forces you to compile every single different type of classification you create, making your program incapable of creating new types during runtime. Which I kind of touched upon indirectly here. And since the obvious conclusion of the Liskov Substitution Principle is that no types can be inherited from any other (complete) type, 50% of the reasoning for using OOP in the first place, simply vanishes!

At least in JavaScript your objects are more fluent, and can be modified during runtime. Prototype-based OO is at least one step in the right direction. But even this way of thinking about objects is too rigid. In fact, any language that is dependent upon the programmer to utilise “design patterns” to fully take advantage of the language, is by the very definition of the term flawed!

7 years ago I tried to write my first MSDN article. Back then I referred to my (immature) method of thinking about objects as “O2”. I still kind of think about my method of creating software as the next paradigm, or OOP evolved. Here you can see my final draft for my article, that was published in MSDN Magazine in March this year. That article was amongst one of the top 20 most read articles in MSDN Magazine for the last 7 years. Which clearly speaks to the fact of that I was able to touch a nerve.

What I did with Active Events, was basically to move polymorphism out of the class constructs, eliminate all types except one (lambda), and eliminated the difference between “data” and “functions”. This allowed me to create software dynamically, in a way that is impossible to understand for people who have been stuck in the OOP paradigm for most of their lives. This way of looking at your code, resembles the real world much more closely. When you need 5 years of learning how “classes works”, simply to be able to create a simple “Hello World” application, without breaking the rules of encapsulation, cohesion and LSP – There is something seriously wrong with your paradigm!

We should warn our kids, with posters like “this is your brain, this is your brain on OOP”. Because a world where all of our children has been raised on OOP, and the insane obsession for classification, is simply not a nice world to live in. Sorry guys, somebody needs to say this out loud, and what needs to be said, is that OOP sucks!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s