2 ms·
> equates to what the DOM _should_ look like is must easier to grep then defining them as literal code, imo It's a common view but really quite a funny form of
by duncanawoods 7y ago
> equates to what the DOM _should_ look like is must easier to grep then defining them as literal code, imo
It's a common view but really quite a funny form of path dependence / mental fixedness. The fact that html elements have been defined with angle brackets is essentially historical accident. It's just a simple hierarchical structure that can be in any notation and any given programming language can happily support this already without new syntax. Yet because of the history, we feel more comfortable with some angle brackets and so we have all this redundant syntactic complexity in jsx/tsx which we would never design without the history.
I'd encourage you to be open minded for going to all code because although there will be an acclimatisation period as you break the historical connection, those familiar angle brackets are totally superfluous.
- halfmatthalfcat 7y agoI've worked with frameworks like GWT and Vaadin enough to know I prefer the DOM way of doing things over visualizing the view through code. Hell, I've used the React programmatic API before I used JSX...never going back.