less_retarded_wiki/oop.md
Miloslav Ciz 39bdc06ddf Init
2021-11-03 15:47:50 -05:00

20 lines
1.6 KiB
Markdown

# Object-Oriented Programming
Object-oriented programming (OOP, also object-obsessed programming) is a [programming paradigm](paradigm.md) that tries to model reality as a collection of abstract objects that communicate with each other and obey some specific rules. While the idea itself isn't bad and can be useful in certain cases, OOP has become extremely overused and downright built into programming languages which often force users to apply this abstraction to every single program which creates [anti-patterns](anti_pattern.md), unnecessary issues and of course [bloat](bloat.md). We therefore see OOP as a [cancer](cancer.md) of software development.
Ugly examples of OOP gone bad include [Java](java.md) and [C++](cpp.md) (which at least doesn't force it). Other languages such as [Python](python.md) and [Javascript](javascript.md) include OOP but have lightened it up a bit and at least allow you to avoid using it.
You should learn OOP but only to see why it's bad (and to actually understand 99% of code written nowadays).
## Principles
## Why It's Shit
- For simple programs (which most programs should be) OOP is an unnecessarily high and overly complex abstraction.
- Great number of the supposed "features" and design-patterns (setters/getters, singletons, inheritance, ...) turned out to actually be anti-patterns and burdens.
- OOP as any higher abstraction very often comes with overhead and performance loss as well as more complex [compilers](compiler.md).
- The relatively elegant idea of pure OOP didn't catch up and the practically used OOP languages are abomination hybrids of imperative and OOP paradigms.
- TODO
## History