Hacker News new | ask | show | jobs
by hunterb123 1685 days ago
> If that’s the point, why are you telling people it’s JavaScript? You can make that point just fine without starting arguments.

First, I say it's JS because it is. Just as decorators are JS. By being an extension of JS it is JS. The two are mutually inclusive.

Second, I didn't want to start an argument, I wanted to call out the very wrong blog post, how it referenced React not JSX, how the spec is an extension of JS, explain the limitations, etc. Until now it was more of a debate. Now it's a bit more of a semantics debate unfortunately.

> But you are starting this stupid debate by telling people it’s JavaScript when it isn’t. If you are tired of people pointing this out when you call it JavaScript, why do you do it? There seems to be absolutely nothing to gain from that except “a stupid debate”.

Actually if you go up the comment chain you'll see I didn't start this debate. If you're tired, just don't participate.

> We are not talking about the value of JSX, merely whether it is JavaScript or not. JSX could cure cancer, but it still wouldn’t be JavaScript.

Oh but we are, again if you go up the comment chain, it's being compared to Svelte's template system, that's how it got brought up, and that's usually why this topic gets brought up. You don't have to create a whole template system. You just use nested functions. To use pretty brackets it needs a small extension of the spec. You don't have to come up with a loop system, a conditional system, etc.

1 comments

> By being an extension of JS it is JS. The two are mutually inclusive.

This is absurd. If JSX were JavaScript, JavaScript wouldn’t need to be extended to include JSX. The whole point of it being an extension is that JavaScript doesn’t include it, therefore JSX extends it. If JSX were JavaScript, then JavaScript wouldn’t need to be extended. The two are mutually exclusive.

> > We are not talking about the value of JSX, merely whether it is JavaScript or not. JSX could cure cancer, but it still wouldn’t be JavaScript.

> Oh but we are, again if you go up the comment chain

In the context of “Is JSX JavaScript?”, the value of JSX is irrelevant. Whether JSX is useless, useful, or amazing makes zero difference to the question of whether JSX is JavaScript or not.

You can still go around telling people JSX is great. It doesn’t have to be JavaScript for you to do that. People telling you that it isn’t JavaScript aren’t telling you that it’s worthless. They are just telling you that it isn’t JavaScript.

Are decorators JS? Answer that question and I'll respond to the rest of your comment.

We're talking in circles a bit so I'd like to drill that down first.

Decorators are a stage two proposal. This means that they are not yet JavaScript, but are expected to be soon.
The point of all of this is it's a JS feature, not a system written on top of JS. A few syntax changes unlocks the rest of JS instead of having to reinvent the wheel, making your own loop and conditional systems. I don't see why the semantics of it not being included yet doesn't make it JS.

When the feature isn't in all browsers and only Babel doesn't make it not JS, similar to how async functions were JS before being natively in JS engines.

You're not being genuine when you say decorators aren't JS. No one looks at Angular 2 and says "whoa that's using some foreign language mixed with JS", they say it's using a JS experimental feature.

I'll concede that it's not "JS" it's an "experimental JS feature", I'll use that in the future to avoid this pedantic debate.

> I don't see why the semantics of it not being included yet doesn't make it JS.

You don’t see why something not being included in JavaScript doesn’t make it JavaScript? Really?

> I'll concede that it's not "JS" it's an "experimental JS feature"

JSX is not an experimental JS feature. You’re trying to draw an equivalence between decorators and JSX, but they aren’t equivalent at all.

Decorators were submitted for inclusion into JavaScript. They have undergone a lot of review to determine whether they belong in JavaScript, and people agreed they did. The specification has been refined to make them suitable for inclusion into JavaScript. Everybody plans on decorators becoming part of JavaScript. Browsers will implement decorators.

JSX, on the other hand, is explicitly not proposed for inclusion into JavaScript. The second and third sentences of the JSX specification read:

> It's NOT intended to be implemented by engines or browsers. It's NOT a proposal to incorporate JSX into the ECMAScript spec itself.

The second sentence is even bolded in the specification. They wanted to be 100% clear about it.

The standards committee isn’t reviewing JSX for suitability for inclusion into JavaScript. Nobody is planning on JSX becoming part of JavaScript. No browsers are planning on implementing JSX.

These are two entirely different situations. Decorators being on the cusp of becoming JavaScript does not mean that JSX is JavaScript.

So far he's ignored instead of addressing all the valid points you've made, and now he's trying to derail the conversation by bringing up experimental features, which, as you say, have nothing to do with anything else.

Since he's working from his own definition of the word "is", and his own definition of the JavaScript standard, there's no way he's going to admit what he said is wrong, even though it is, and the JSX designers were 100% clear in their documentation about shooting down his mistaken idea that JSX is JavaScript.

Now that you've made that point, he's probably just going to try to derail and change the subject again, like he was just trying to do by diverting the discussion to decorators.