3 ms·
By and large, I think inheritance is a major mistake. Interfaces are the only "good" part of inheritance. Sure, there are edge cases where inheritance is trul
by cogman10 6y ago
By and large, I think inheritance is a major mistake. Interfaces are the only "good" part of inheritance.
Sure, there are edge cases where inheritance is truly the best way to do things, but those are few and far between.
I cringe every time I dive into some of my day job's more deeply inheritance based code. It is SO hard to make changes there without breaking a bunch of stuff unintentionally.
- abecedarius 6y agoThe way I'd put it, the mistake was to make inheritance the default. It's a sometimes useful mechanism (called "open recursion" in the FP world).
- BerislavLopac 6y agoIronically, in Python you can use interfaces without ever resorting to inheritance. :)
- cogman10 6y agoTruly a description of dynamic typing :) Interfaces without declaration.
- BerislavLopac 6y agoI didn't say that they were not declared. You can have proper, type-checked and runtime enforceable interfaces, without having to inherit from them.