Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The argument to standardize it isn't really "because React does it", it's "because a ton of developers find it really useful". That seems kind of undeniable to me, even as someone that dislikes a lot of React.


Yep, JSX is even supported in Vue and probably other tooling. This kind of adoption calls for standardization.


He's right, guys.


I don't think that it is sound to incorporate a DSL that imitates html only approximately into a language. That should remain an external library at best.

And that's irrespectively of my view on jsx, the latter which I find non ergonomic and confusing. That many people are being force fed it to the point of familiarity does not mean that it is the best DX.

we went from (html + js> to html in js and js in html. Quite very confusing to me. Knotty (naughty) complexity pun intended.

It's more akin to stockolm syndrom to not improve on the statu quo at this point.


> I don't think that it is sound to incorporate a DSL that imitates html only approximately into a language.

The beauty of JSX is that it's not HTML, it's much more generic.

> And that's irrespectively of my view on jsx, the latter which I find non ergonomic and confusing.

You're in the very, very small minority here. JSX is very clear and intuitive and natural and ergonomic and lovely to most of us.

And I don't even like React!

Compare:

Without JSX: https://github.com/sdegutis/sys32.90s.dev/blob/26bcb088a3df6...

With JSX: https://github.com/sdegutis/os.90s.dev/blob/cc7310633d9ab186...


To provide a quick feedback, I believe the 'without jsx' version could have been improved. One advantage it already has is that it doesn't need the repetition of /closing> elements.

But it doesn't go far enough in terms of function composition to pass arguments. The signature (that resembles react.createElement I guess) is too cumbersome.

That creates a succession of braces and comma which is unfortunate. Just to specify some object attributes. That could be easily a function Attr().

We have higher order functions easily in javascript. We should make use of it.

That eliminates html looking jsx since we just use functions. That's less confusing than pseudo html syntax.


Show me what that code would look like if it was done better.


Maybe you could try with hyperscript syntax for react(which I've just found the existence of).

https://github.com/hyperhype/hyperscript

https://github.com/mlmorg/react-hyperscript

which might be actually similar except for the dollar sign which adds some noise.

But some of your prop/attr setting would be inner function/methods instead of being passed as an array. That would shorten some lines.

> Show me what that code would look like if it was done better

I'm definitely not going to try to provide an example if you do not offer the courtesy of a smaller representative example though.

By the way, why is $(Label,...) not simply Label()? That could be a function.


Eventually I got new Label() working, but Label() by itself isn't possible while keeping them as ES6 classes.

After a while of managing commas, you just begin to long for JSX again. Hyperscript wouldn't solve that.


> It's more akin to stockolm syndrom to not improve on the statu quo at this point.

Describing something very popular as “Stockholm syndrome” because you don’t like it isn’t logical at all.

And it’s easy to say that but I think it's incumbent on you to propose something better if you do.

"No, not JSX. Something better than that." ...but what?


I was far from the only one to not like it when it got introduced.

As I have explained somewhere else, plain function and method composition is clearer in my humble opinion.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: