cvut / javascript

JavaScript Quality Guidelines and Recommendations
MIT License
22 stars 4 forks source link

Why to avoid class: composition vs. inheritance #7

Open jnv opened 9 years ago

jnv commented 9 years ago

Revisiting the guide a some of this stuff is primarily an opinion without substantial reasoning. Case in point is the recommendation to avoid ES6 class. For me the primary reason is that it invites reliance on inheritance and hinders composition, which is actually described in few of Elliot’s articles (and raison d'être of stampit). I should add it in later revision.

(But to be absolutely honest, my primary objective with such an opinionated guide is to push devs out of their comfort zone and rethink practices before they repeat the same mistakes we are doing in other languages. They can disagree, but they need to think why.)