2 ms·
There used to be times when language-level composition did not exist, so inheritance was practically all you had. There used to be ugly hacks to implement mix-i
by WesolyKubeczek 1y ago
There used to be times when language-level composition did not exist, so inheritance was practically all you had. There used to be ugly hacks to implement mix-ins, for example, in PHP (first versions of Symfony used them and did their best to make them not ugly, but they had to devote a whole chapter on how to do them right anyway). I suspect a lot of contention comes from those times — and from the fact that even when you can do better, many folks still have the muscle memory wired to "if inheritance is the only tool you have, everything looks like a subclass".
I like languages where I can have both, and where the language authors are not trying to preach at me.