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?

Appendix. There is a very good reason why hardly any of us wears a mask today. If masks prevented the transmission of respiratory diseases, it would have been a medical breakthrough. But they do no such thing. There is no evidence that masks have benefits and they may well create net harm. The one European country that did not embrace general mask mandates (Sweden) ended up with effectively the lowest excess mortality in Europe.

Cochrane conducted a thorough review of all the strong evidence gathered during the covid era. Here is what the Cochrane review conclude:

We included 12 trials (10 cluster‐RCTs) comparing medical/surgical masks versus no masks to prevent the spread of viral respiratory illness (two trials with healthcare workers and 10 in the community). Wearing masks in the community probably makes little or no difference to the outcome of influenza‐like illness (ILI)/COVID‐19 like illness compared to not wearing masks. Wearing masks in the community probably makes little or no difference to the outcome of laboratory‐confirmed influenza/SARS‐CoV‐2 compared to not wearing masks. Harms were rarely measured and poorly reported.

Here are the results from an earlier Cochrane review, based on pre-COVID studies:

Compared with wearing medical or surgical masks, wearing N95/P2 respirators probably makes little to no difference in how many people have confirmed flu; and may make little to no difference in how many people catch a flu-like illness.

Ian Miller wrote a fantastic book on the topic: Unmasked: The Global Failure of COVID Mask Mandates.

Atlas et al. (2024) included masks in their lessons to draw from the covid era: Masks Were of Little or No Value and Possibly Harmful.

German officials admitted that evidence for making masks mandatory was lacking, according to health agency’s deliberations released after long legal battle.

Sandlund et al. conclude:

Because benefits of masking for COVID-19 have not been identified, it should be recognised that mask recommendations for children are not supported by scientific evidence.

Daniel Lemire, "Learning from the object-oriented mania," in Daniel Lemire's blog, May 14, 2024.

Published by

Daniel Lemire

A computer science professor at the University of Quebec (TELUQ).

7 thoughts on “Learning from the object-oriented mania”

  1. Interesting essay. Also interesting to contrast with functional programming which didn`’t get the same enthusiasm and support behind as OOP.

  2. I have a bookmarks directory in my browser called “Common Sense”. I like re-reading posts in it from time to time. Added this one in there as well.

  3. Then we had: micro services, blockchain, LLMs -manias. There’s something fundamental about the interplay of incentives between media, companies, consultants, developers, that results in one mania after the other. Reminders like your’s should theoretically help…

  4. TDD.
    Micro services.

    All of these (and the OOP craze, and the XML) have in common that neither are bad ideas in itself, but the cultural interplay described above is so obvious, that they are all bound to fail in the long run.

    It’s not even classic hype cycles. This is something else, where the culture fundamentally changes a generation to reason in those terms only. I’m not sure what the long term fix would be. I had a theory that low level assembly programming first, would inoculate against complexity, but that have not worked out in practice.

  5. Good! I only wonder how far we really get with the list of “telltale signs” you mention, to help us identify the hypes:

    Assume OOP, or, say, masks, had actually been wonderful & inevitable. I guess most of the ‘signs’ you point out would have manifested themselves similarly strongly. Possibly even more strongly.

    If so, the list of signs might get us only so far. A good portion of deep independent thinking and familiarity with the topic at hand may often remain rather crucial to discern hype from actual progress.

Leave a Reply

Your email address will not be published.

You may subscribe to this blog by email.