4 ms·
This advice/reflection could apply equally to any style of programming, except for one particular snippet. You haven't made or refuted any OOP-specific claims.
by mrkeen 8y ago
This advice/reflection could apply equally to any style of programming, except for one particular snippet. You haven't made or refuted any OOP-specific claims. Separation of concerns? Egotistical soapbox speaker? Strong domain layer? What do they have to do with OOP, as opposed to just P?
Except for this:
> favor composition over inheritence
Yes! Inheritance is OOP-specific, and I agree that you should avoid it.
- peteradio 8y agoBut 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