It’s not that I don’t like true OOP. I’ve just seen class-based OOP abused so much that I agree with Brian Cantrill about the “dark times” of the 90s when it emerged. Here’s another explanation:
“The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.” – Joe Armstrong
First let me say that there are many principles that are associated with OOP that are not in fact just OOP:
These things are well-established best practices and present in many other languages with different paradigms.
But the class-based OOP primarily associated with Java and C++ and SmallTalk (originally) has been overwhelmingly proven to be a broken paradigm — especially single inheritance models.
What really pisses me off is how totally entrenched it has become in everything down to our AP computer science tests. The entire industry has been plagued by the largest marketing efforts ever done for a programming language ($500k for Java) and we are still seeing its massively negative affect all through the industry even today.
For those who truly want to understand this issue (and frankly most who ask me the question don’t) then watch the following videos completely before you ever breathe a word of question about this to me. Otherwise, you are just wasting all of our fucking time.
My favorite is this video from Jim Coplien:
Jim: “Who here is has ever done any object-oriented programming?”
Crowd sheepishly raises hands.
Jim: “Okay, you there, what language to you program in?”
Scared Coder: “Java”
Jim spitting and pointing: “Java is the only language in which you cannot write object-oriented programming code!”
Why all that?
Because no one even knows what the fuck true object-oriented programming even is. I didn’t. I drank the Koolaide in the 90s big time. I even gave presentations at conference about Java. I coded thousands of lines of Java, and was burned by all the negative things that are not widely regarded as the problem. At one such conference one of the creators of Java was asked a telling question:
“If you could change one thing about the language what would it be?”
“Inheritance, “ he replied.
The crowd roared with laughter because they thought he was kidding.
He wasn’t.
People throw the words related to OOP around like crazy because the gang of three dumb asses convinced the world that things like Java and C++ are actually object-oriented, but they never were. You cannot even code OOP in Java. In C++ you can, but you have to break from the ++ part and more of the C part.
There are two other great video references to these problems. My favorite is from Brian Cantrill but Brian Will’s video is also very good, just less comedic.
So no jungle with your banana.