3 ms·
But why? Why avoid inheritance?
by peteradio 8y ago
But why? Why avoid inheritance?
- vikingcaffiene 8y agoInheritance is a powerful tool. And like anything powerful, you need to think very hard about it use and assess whether another approach might be more well suited to what you are trying to accomplish. In my experience the reason people use inheritance is often simply to share common functionality. There are a lot of ways to get that done that don’t require inheritance.
- LoSboccacc 8y agoif done improperly one ends up having to maintain backward compatibility in the parent object not just on the actual interface but also in the internal state. basically makes it too easy to violate incapsulation one needs not to avoid it completely but need to be aware of the pitfalls