re: Sh*tpost: can we stop saying "syntactic sugar"? VIEW POST

re: Syntax sugar is a sweet way to say "This code is not giving any extra business value". For example, JSX is for to write the DOM, so instead of wri...

I didn't think about the performance tradeoff JSX might introduce. I don't have a huge understanding of React (attempted to learn twice while working fulltime and turned to vue eventually. Heard of its virtual DOM).Did you mean it is slower than other frameworks or... than writing the same thing in JS itself?


The concept of virtual dom is cool. However, it is not really usable for every single application.

For example, let's say a classic web: HTML + JQuery. I draw the HTML (that is fast) then I call JQuery to modify the DOM. If the changes are minor, then modifying the DOM directly is quite fast, for example reading field of a form.

The alternative is to create a JSX and to use React to render the HTML (so the browser is doing an extra job). And, if we want to modify the dom, then we access the virtual dom. This virtual dom accesses to the dom, so we are adding a new layer again.

JSX shines when we need to modify intensively the DOM.

Code of Conduct Report abuse