3 ms·
Yet another post titled "don't do X", which actually reads as "do not exaggerate with X" or "did you know? X has some caveats". Of course inheritance is not a
by V-2 13y ago
Yet another post titled "don't do X", which actually reads as "do not exaggerate with X" or "did you know? X has some caveats".
Of course inheritance is not a solution for everything. Avoid using deep inheritance hierarchies, you'll paint yourself into a corner. It's advisable to prefer composition over inheritance. You should not be that guy who only has a hammer and everything looks like a nail to him. But it doesn't translate into: "hammer? don't do that!"
All the examples he's giving either demonstrate abusing the inheritance concept or just show that it has certain limitations. There are well known solutions and guidelines for dealing with problems such as fragile base class, other than throwing the whole paradigm out of the window