I believe that if composition or aggregation suits your program design better, then you should use it. However, it is disingenuous to suggest that you should never use inheritance. Inheritance can be enormously useful in many situations, such as GUI programming and video game development.

OOP does not mandate using inheritance all the time. Inheritance is just another tool available to you. The same with composition/aggregation. As always, choose the right tool for the job.

To say that inheritance is evil is absurd and reflects profound ignorance.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store