4 ms·
It is not an obscure opinion at all. If anything, us inheritance lovers are on the defensive (the entire OOP community is, but that is another story).
by seanmcdirmid 12y ago
It is not an obscure opinion at all. If anything, us inheritance lovers are on the defensive (the entire OOP community is, but that is another story).
- Tloewald 12y agoThere's an in-between option seen in some languages where you don't inherit and override but instead implement a superclass's stub (or event if you want to think of it another way), which I think gives almost all the benefits of inheritance without most of the downsides. Sadly it hasn't penetrated the "major" languages.
- seanmcdirmid 12y agoThat would negatively effect the encapsulation benefits of inheritance: we could never safely access private fields on any value other than "this." Try implementing binary methods without that! Inheritance should evolve...there is plenty that can be done with it (e.g. mixin-style inheritance, dynamic inheritance, family inheritance). At the very least, we should have that conversation on how to address inheritance criticisms.