DEV Community

Discussion on: Technologies that makes JavaScript a beautiful programming language!

Collapse
 
seanmclem profile image
Seanmclem

Jsx is beautiful. Hooks too

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

I never think JSX is beautiful. Rather, lit-html, or template strings, is quite similar, but more light-weight. Not sure if JSX is more efficient.

I also like createElement as e, also hyperscript.

I actually like Vue syntax for now, but the alternative is actually importing *.html via raw-loader.

I reality, use Pug in Vue.

JSX is just too forced and popularized by marketing, I think.

Thread Thread
 
seanmclem profile image
Seanmclem • Edited

"Forced and popularized by marketing" sounds more like your opinion based on your views of the Facebook corporation involvement in React development, not an actual judgment of JSX from a technical or efficiency perspective.

Also, JSX may have been created by them, but is just an open syntax and is usable outside of React. It works great in preact, or stenciljs.

Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Actually, I changed my mind. JSX might be nice after all, but please give better reasons first rather than forced. (This one is lit-html. I have only found it today.)

Rather than make it non-obvious by their official reasons. (I found this one ages ago.)

I found the reasons later, though

  • Hyperscript is bad for auto-formatters
  • They didn't even mention lit-html or pug -- I just love Pug, BTW.
Thread Thread
 
seanmclem profile image
Seanmclem • Edited

Okay you've lost me. Nobody forces anyone to use jsx, people use react and jsx because they love it. React works without it, and you can use it elsewhere outside react. Lit-html is okay sometimes. It requires more work, looks less clean, and it's less flexible. But personally I don't prefer it. Everyone's different.