3 ms·
Class inheritance in OOP seems to be largely derived from such contrived examples as "Duck extends Animal." It's basically a worthless concept and OOP would be
by sumy23 4y ago
Class inheritance in OOP seems to be largely derived from such contrived examples as "Duck extends Animal." It's basically a worthless concept and OOP would be better without it. Composition over inheritance leads to much better code.
- lamontcg 4y agoYou still need to extract the right components and abstractions. And inheritance can be expressed in terms of composition, the base class(es) can be represented as composition and delegation instead (with a protected interface, a public interface and the implementation details all tightly coupled behind a single name which is what really makes it so poor).