7 ms·
JSX is redundant, at best. VanJS demonstrated ordinary JavaScript syntax is as good as JSX, if not better. How can something feel sugar-ish if it's actually mor
by flying-pig 3y ago
JSX is redundant, at best. VanJS demonstrated ordinary JavaScript syntax is as good as JSX, if not better. How can something feel sugar-ish if it's actually more verbose than ordinary JS code? Plus, you can't really execute JSX code in browser's developer console.
- least 3y ago> How can something feel sugar-ish if it's actually more verbose than ordinary JS code? I personally find XML much easier to parse than a lot of nested callbacks and I especially like that content is always inside tags, rather than another argument as part of the library's functions. p("Hello, world") is readable enough, but as soon as you start adding html attributes, it becomes less legible to me: li(a({href: "https://vanjs.org/ https://vanjs.org/"}, "VanJS")) vs. <li><a href="https://vanjs.org/">VanJS</a></li> https://vanjs.org/">VanJS</a></li> I'm certain some people probably prefer the former over the latter, but I much prefer how JSX/XML reads. I can immediately tell where the content starts and in formatted code, I think it's a lot easier to see visually where things start and end, because of closing tags, instead of just a parentheses.
- ping-monkey 3y agotbh, you don't need JSX to know where things begin and end (if this is something really important for you): li(a({href: "https://vanjs.org/ https://vanjs.org/"}, "VanJS")/*a*/)/*li*/