Learning from the Object-Oriented Mania

Learning from the Object-Oriented Mania

Back when I started programming professionally, every expert and every software engineering professor would swear by object-oriented programming. Resistance was futile. History had spoken: the future was object-oriented.

It is hard to understate how strong the mania was. In education, we started calling textbooks and videos ‘learning objects‘. Educators would soon ‘combine learning objects and reuse them‘.

A competitor to a client I was working on at the time had written a server in C. They had to pay lip service to object-oriented programming, so they said that their code was ‘object-oriented.

I once led a project to build an image compression system. They insisted that before we even wrote a single line of code, we planned it out using ‘UML’. It had to be object-oriented from the start, you see.

You had to know your object-oriented design patterns, or you could not be taken seriously.

People rewrote their database engines so that they would be object-oriented.

More than 25 years later, we can finally say, without needing much courage, that it was insane, outrageous, and terribly wasteful. 

Yet, even today, the pressure remains on. Students are compelled to write simple projects using multiple classes. Not just learn the principles of object-oriented programming, which is fair enough, but we still demand that they embrace the ideology.

To be fair, some of the basic principles behind object-oriented programming can be useful. At least, you should know about them.

But the mania was unwarranted and harmful.

The lesson you should draw is not that object-oriented is bad, but rather that whatever is the current trendy technique and trendy idea, is likely grossly overrated.

The social mechanism is constantly in action, though it is no longer acting for object-oriented programming. It takes many forms. Not long ago, you had to wear a mask to attend a conference. Everyone ‘knew’ that masks stopped viruses and had no side-effect… just like everyone just knew that object-oriented programming makes better and more maintainable software, without negative side-effects. All experts agree. All figure of authorities agree. The written press agrees. The celebrities agree. The social pressure to conform is everywhere. It must be true, it has to be true. Anyone disagreeing is a bad person.

You can recognize such a social contagion by its telltale signs.

  1. Rapid Spread: A social contagion spreads quickly through a group or community, much like a wildfire. One day everyone is talking about the latest object-oriented pattern, and the next day, everyone is putting it into practice.
  2. Amplification: You often observe the emergence of ‘influencers’, people who gain high social status and use their newly found position to push further the hype. The object-oriented mania was driven by many key players who made a fortune in the process. They appeared in popular shows, magazines, and so forth.
  3. Peer Influence: Social contagion often relies on peer influence. E.g., everyone around you starts talking about object-oriented programming.
  4. Conformity: People often mimic the behaviors or attitudes of others in their group, leading to a conformity effect. People who do not conform are often excluded, either explicitly or implicitly. For example, object-oriented started to appear in job ads and was promoted by government agencies.
  5. Aggressive Behavior: You see a significant change from usual behavior as irrationality creeps in. If you criticize object-oriented programming, something is wrong with you!
  6. Grandiose Beliefs or Delusions: Claims that object-oriented programming would forever change the software industry for the better were everywhere. You could just easily reuse your objects and classes from one project to the other. Never mind that none of these claims could ever be sustained.
  7. Risky Behavior: Entire businesses bet their capital on projects trying to reinvent some established tool in an object-oriented manner. People kept throwing caution to the wind: let us rebuild everything the one true way, what is the worse that can happen?

Daniel Lemire, “Learning from the object-oriented mania,” in Daniel Lemire’s blog, May 14, 2024.

Published by

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *