Hacker News new | ask | show | jobs
by khalilravanna 3801 days ago
I think the cheatsheet does a great job of summarizing what makes me uncomfortable with es6 classes:

>"...the syntax for creating classes in ES6 obscures how implementation and prototypes work under the hood..."

Yes, it's great for if you're uncomfortable with prototypal inheritance and the "javascript way of doing things" (I'll maybe summarize that as composition over inheritance, mixins, knowing how to use call/apply etc.), but at the end of the day I'm worried it might be a crutch. Specifically, it might create the situation where a javascript noob might use es6 classes and never bother to learn how the prototypal chain works or all the myriad options available for mocking classes and OO behavior. That being said, maybe that's a shitty argument. When you have more tools in the toolbox there's always the option for someone picking the wrong tool. Does that mean you take the tool out? Or leave it because it is really useful when you know when to use it correctly. I imagine the latter.

1 comments

Agreed. And I meant prototypal, not prototypical :)