Hacker News new | past | comments | ask | show | jobs | submit login

- More declarative.

- Harder to screw up. Even if you know what you're doing, prototypical inheritance involves several steps which can get repetitive.

- Interoperable with non-es6 "classes". It's not like you're losing anything.




Actually it might be easier to screw up. People will think these are real traditional "OO" classes but they are not. Its all prototypal, and you will be in a world of hurt creating bug and performance hits if you treat them as if they are the same. Also, functions inside a ES6 class are hijacked. You cannot bind those functions to work on another context which is a core javascript technique, it will break. Thus in the end, any person familiar with javascript will have to learn even more caveats which will create more confusion. You wouldnt want to use ES6 classes on anything super complex.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: