3 ms·
I disagree on this one. Before `class`, people built ad-hoc class-like constructs based on prototype inheritance. Often in slightly different ways, with differ
by the_duke 5y ago
I disagree on this one.
Before `class`, people built ad-hoc class-like constructs based on prototype inheritance. Often in slightly different ways, with different constructor choices and different implementation details.
For larger code bases in team environments class is a really critical standardization, otherwise you can easily end up with a mess.
It's also important for tooling, because IDEs can much better understand what's going on and present information better.
Now, if Javascript really needs things like private class members and a lot of the other difficulties around classes is another question.
- szastamasta 5y agoI personally see very few use cases for classes in JS. Most of the stuff can be solved by using factories and objects without all "this" issues.
- qwerty456127 5y agoI appreciate your opinion and generally agree but feel like you probably meant this to be a response to some other comment.
- the_duke 5y agoWhoops, indeed, the intended target was https://news.ycombinator.com/item?id=28549925 https://news.ycombinator.com/item?id=28549925.