3 ms·
I've seen a few clean examples where it works really well. Particularly, Java's AbstractMap is a thing of beauty in the amount of code it saves you if you need
by cogman10 6y ago
I've seen a few clean examples where it works really well.
Particularly, Java's AbstractMap is a thing of beauty in the amount of code it saves you if you need to make your own map data structure for whatever reason. One method override and you have all the Map functionality.
Otherwise, I agree that it is an Anti-pattern like 99% of the time. Young devs tend to reach for inheritance almost out of instinct whenever they have code they want to share. It's a hard habit to beat out of college grads (Honestly, some of our senior devs haven't learned that lesson :( )