OOP a software development mass psychosis
Tags: programming, discuss, architecture
Published: 2022-05-02 09:07:00

A broad layman's definition of a psychosis is roughly; _"The belief in something that has been proven to be wrong"_. The definition of a mass psychosis is when a lot of people shares this false belief.

History is full of mass psychotic incidents, and today is not different in any ways. My favourite mass psychotic incident from history is _"the dancing plague"_ from 500 years ago in Germany, when literally thousands of people danced themselves to death from exhaustion without any apparent reason. Some 30 years ago, Russian authorities had to close down primary schools in several districts to contain their _"laughing plague"_ that started spreading at one primary school amongst teenagers and kids, resulting in children laughing so hard they could barely breadth. One small group of children had started laughing in one class room, and before the end of the week the thing had spread to dozens of schools, with hundreds of hysterical kids incapable of stopping their hysterical laughter. Psychologists were called in, and the area was set into a _"temporary state of health emergency"_ and children were isolated at home to try to prevent them from literally laughing themselves to death by choking ...

For 30+ years, software developers have been taught a mantra that over time has turned into more or less the declaration of faith required to believe in to be able to land a job as a software developer, and this mantra is as follows.

> Object Oriented Programming is a good thing

When in fact 30+ years of history has taught us the exact opposite. For instance ...

* Implementing encapsulation in OOP results in unnecessary complexity and virtually impossible to understand code
* Polymorphism results in chaos and extremely hard to track down bugs
* Coupling data (fields) with logic (methods) is the recipe for disaster, and entangles your logic and data in ways that are arguably the very definition of madness
* Single responsibility results in 1,000+ classes for something that could have been done with 5 functions in FP.

I could go on and mention hundreds of such issues with OOP. However the proof is in design patterns, clean architecture, and SOLID. If OOP was a solution to anything really, we wouldn't need design patterns, clean architecture, or SOLID design principles. OOP itself would be enough for us. The fact that OOP need crutches to stand upright, is by itself enough proof for us.

I once heard a LISP developer prove how 19 of the 23 original design patterns from GoF's book made absolutely no sense what so ever in LISP. In fact, you can quantify a programming language's amount of _"psychosis"_ according to its required number of design patterns in order to correctly use the language. If you do, you will realise that 99% of all design patterns are simply _"hacks"_ around OOP's inadequacies.

Of course for a developer who just started out coding, having read all the marketing gibberish for OOP, separating the truth from fiction becomes incredibly hard. It's therefor the responsibility of the senior developer to _stop this psychosis_, and explain the advantages of more functional programming languages to junior developers, such that we can hopefully collectively discard this paradigm that originally came out of Simula 67 in Oslo more than 50 years ago - OOP that is of course ...

AA have a 12 step program for healing yourself from addiction. Paradoxically, the same steps can be applied to almost anything in this world, and the first step is always as follows ...

> Step 1, realise you have a problem

The problem of course is OOP, and the realisation point is the point in time when you utter this out loud, not afraid of the consequences - Admitting that OO is in fact a psychosis, and not a _"brilliant software development paradigm"_ in any ways what so ever. For crying out loud, every single computer process consists of more or less the exact same parts; Input + process results in output. Exchange process in the former sentence with a verb, and you've effectively illustrated every single (successful) computer process that was ever created.

When it comes to verbs, functional programming is simply superior to OOP with its _"subjects"_, in every regard that exists. So say after me as follows ...

> OOP is a psychosis! It is not a solution, it is **the** problem!

For the record, if you want to work in a sane programming language, there exists dozens of nice languages out there, such as for instance ...

* LISP
* GoLang (yup, no OO here)
* F#
* Or my personal favourite (shameless plug) of course [Hyperlambda](https://aista.com)

When it comes to OOP, ask yourself the following; _"What would Ronald Reagan and Nancy Reagan do?"_ - The answer of course is simple ...

> Just say no!