Eric Elliott
Jul 28, 2017 · 1 min read

This entire series is based on the idea that composition is the very essence of what software development is.

We let that first principle guide the selection criteria for the tools we employ as we build our apps, and as a result, we get code that’s much more flexible and easier to adapt to new use cases. See “Composing Software: An Introduction”.

As this article demonstrates, the class keyword in JavaScript makes composition harder in general. It’s still possible to compose classes using the composite pattern, but that’s a lot more work with zero gain.

You can also compose using a higher-order class which takes classes as arguments and returns a composed class to extend from, but that’s also a lot more work, with zero gain.

If I’m going to work a lot harder at something, I want to get something useful out of it.

    Eric Elliott

    Written by

    Make some magic. #JavaScript

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade