This lesson was translated automatically – it may contain errors.
OOP won: almost everything we use every day is written in it, and almost every mainstream language of the past thirty years is object-oriented. Which makes what comes next all the stranger: the languages being designed now deliberately drop parts of it – inheritance here, classes altogether there.
That is the paradox: the industry writes in OOP and walks away from it at the same time. So something in the paradigm was solving a problem of the 1970s rather than today’s. What exactly turned out to be unnecessary, and why – that is the question this course will try to answer.
Who dropped what
Arguing about OOP in general leads nowhere – look at specific languages instead. Here are four, and all four dropped something different. Switch between the tabs:
Go – no classes, no inheritance, no type hierarchy. What is left is structs, methods and interfaces, and an interface is implemented silently: a type simply has the methods required, no kinship to declare. Instead of «this class descends from that one» it is «this type can do what the caller needs».
Rust – no classes, and no inheritance as a matter of principle. Data lives in a struct, behaviour in a separate impl block, shared behaviour is described by traits. What OOP does through a base class is done here through «can do this» – and the compiler checks it.
Zig – no object machinery at all: structs and functions, everything explicit. The language deliberately refuses to hide either allocation or dispatch behind a call. Encapsulation here is not about private fields but about what happens being visible in the code in full.
Elixir – data is immutable, functions live apart, classes are neither there nor intended. What it does have is processes that exchange messages and keep their own state – exactly what Alan Kay called object-oriented programming. Formally not OOP; in spirit closer to the original than Java.
Each of them threw out something of its own:
- Go – the type hierarchy;
- Rust – inheritance;
- Zig – implicitness;
- Elixir – mutable state.
Did their authors remove OOP – or keep the most valuable part of it and throw away the rest?
Keep that question in mind until the end of the course. By the last module you will have enough material to answer it yourself instead of quoting somebody else’s opinion.
What to test against time
As you work through each mechanism that follows, ask yourself two questions:
- which specific problem it solved when it appeared;
- whether that problem is solved some other way today.
Some of the answers will surprise you. Inheritance, for instance, is used in modern code noticeably less than its authors expected – and the patterns in the last module say so honestly.