r/node • • Oct 06 '15

Why ES6 Has Classes

https://github.com/runvnc/whyes6hasclasses
0 Upvotes

7 comments sorted by

2

u/[deleted] Oct 06 '15 edited Oct 06 '15

...What is this even? What are you even on about?

The concept of a class and implementation of classes in Javascript are two completely different things. You've literally made no valid points for the class keyword which is being introduced in ES6.

If we look at TypeScript's transpilation of the class keyword, we can see that classes are basically closures that return a user-defined object type.

var Car = (function () {
    function Car() {
    }
    return Car;
})();

One of the biggest arguments against ES6 classes are that it's just syntactical sugar around basic JavaScript patterns. You haven't mentioned this at all. In fact, the more I read your page the worse it gets. What does React.js have anything to do this JavaScript classes? Why did you even make this page?

Edit: if this isn't enough, you went and opened a GitHub issue on the Node.js repo that directly contradicts the points made in this article. Idk if anyone else feels this way, but right now I believe a big solid fuck off is warranted. We already have enough noise in the Node.js community.

3

u/CertifiedWebNinja Oct 06 '15

if this isn't enough, you went and opened a GitHub issue

Ben Noordhuis was having NONE of that. Hahahahaha

-11

u/runvnc Oct 06 '15

Yeah go fuck yourself too. My issue on github was funny. Sort of amazing some people didn't get the joke.

4

u/[deleted] Oct 06 '15

I got the sarcasm. It was rude. You're a rude person so it's only fair I'm rude to you too.

1

u/Hypercubed Oct 06 '15

I think your point is that where there were once many ways to make a JavaScript class-like object, there is now one preferred way. It is a valid point but somewhat obscured by the rhetorical voice you employ in this story. I would suggest you rewrite your argument a little. Just a kind suggestion. If you do please consider dropping me a note here: https://github.com/Hypercubed/javascript-the-esoteric-parts

0

u/[deleted] Oct 06 '15

[deleted]

-2

u/runvnc Oct 06 '15

Did you read the stuff before that conclusion?

1

u/shriek Oct 06 '15

Because React and Node are using classes that's why? I think OP is looking for some technical aspect of it, not just "look this popular library is using it and so it must be important" reasoning.