2 ms·
"it seems awkward, fragile and ill-thought-out" Or, you know...not. Sometimes, inheritance is the perfect abstraction for the job, neither awkward nor fragile
by timr 16y ago
"it seems awkward, fragile and ill-thought-out"
Or, you know...not. Sometimes, inheritance is the perfect abstraction for the job, neither awkward nor fragile, but perfectly elegant. Which was my point.
When you've got an is-a relationship, inheritance often makes sense, and encapsulation is frequently awkward. When you've got a has-a relationship, inheritance is frequently awkward. Just because you can find an awkward use of inheritance or a leaky abstraction doesn't mean that inheritance is awkward. It's a tool with limitations, and the world is a messy place. Containment isn't a magic bullet, either.
I honestly don't understand where the bias against concepts comes from. When the concept works, you use it. When it doesn't, you don't. It's engineering, not religion.