The Tragic Death of Inheritance

https://avivcarmi.com/the-tragic-death-of-inheritance/

I thought this was an interesting article, that might be of interest in this community since rust is one of the new languages that uses Composition over Inheritance.

TL; DR by the author:

This is a story about how I felt forced to give up inheritance and object-oriented programming, and still missed it for a very long time. And why now, half a decade later, I believe that inheritance is an inferior choice in most cases.

26 points · 2 comments · view on lemmy.world

2 Comments

sugar_in_your_tea@sh.itjust.works · 7 pts · 3y

I still believe inheritance can be a good solution when modeling a real taxonomy-based problem.

As I'm fond of saying, the right choice given two extremes is usually in the middle.

I wish Rust had inheritance, if only to make modeling taxonomy-based structures (like GUIs) easier. But given the choice between a good composition system and a good inheritance system, without being able to have both, I'll take the good composition system

Tyr3al@feddit.de · 5 pts · 3y

Good read. Thanks for sharing!