| aquaz (166) | ||
|
My point is that inheritance should never be used by "laziness". Avoiding code duplication by using inheritance is laziness I think because it is not flexible and composition is more suited for that. I have this opinion because when I discovered OOP I used inheritance typically to put common behaviour in a base class with a big hierarchy, as all OOP beginners do. But at some point I realized how unflexible this architecture was and the code became more and more terrible and unmaintenable. That's why MI is rarely useful. In a ideal world, only leaf class of a hierarchy should contain code. (but this is utopy, i admit i am lazy sometimes and everyone is:)
I think we will never see that in the standard for the same reason. But as a compiler extension handled by major compilers like pragma once, why not.
| ||
|
|
||