I agree that inheritance can be problematic, but I don’t agree that it should be satanised.
Pier Bover
1

GoF was written from a Java perspective. I’ve never seen a use-case in JavaScript where class inheritance is a better fit than object composition in my entire career. I’ve seen lots where we thought it was a good fit, until new requirements came along and we realized we were wrong.

Eventually I realized that every time I chose class inheritance I was wrong.

Additionally, I’ve been challenging software devs to provide a good use-case for many years. Over a million developers have heard the call. 100% of respondents offered use-cases where composition is really a better call, or they were confused by common misconceptions.

Like what you read? Give Eric Elliott a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.