Good advice. Inheritance looks like simple code reuse, but it's extremely inflexible. Every CS 101 class goes through that Mammal.breathe(), Mammal::Animal.walk(), exercise, and every time, someone asks, "Well, what do I do with a dolphin?" Do you borrow swim() from Fish? Or breathe() from Mammal? Or reimplement them? Or what?
I'm convinced they're actually identifying a deep problem with inheritance as a paradigm.
I won't say it's useless; sometimes you really do have an ironclad relationship. But I think if you just want to communicate that your object fulfills a promise, an interface is better. And if the code reuse is circumstantial rather than essential, you're better off reaching for multiple inheritance from partial classes -- traits, mixins, whatever your modern language calls them.
I'm convinced they're actually identifying a deep problem with inheritance as a paradigm.
I won't say it's useless; sometimes you really do have an ironclad relationship. But I think if you just want to communicate that your object fulfills a promise, an interface is better. And if the code reuse is circumstantial rather than essential, you're better off reaching for multiple inheritance from partial classes -- traits, mixins, whatever your modern language calls them.