Recently we discussed a defect mentioned here and one of the parties said something like “yes, that’s why books say that inheritance should be avoided.
I’ve been using inheritance for years and find it very useful and convenient in many design cases. Also I’m sure that the person arguing at the very least misunderstood what those “books say”.
Is there really an idea that inheritance is kind of bad and should be avoided? Where does it originate and where can I learn more?
I think what he might have meant is that inheritance can be overused, even in cases where composition would be a better solution. This is discussed in several books, e.g.