3 ms·
I appreciate your view here, and to some extent you have valid points – but you're also way off the mark in several ways that don't really do anybody any favour
by matthewmacleod 9y ago
I appreciate your view here, and to some extent you have valid points – but you're also way off the mark in several ways that don't really do anybody any favours. Ultimately I think that precision is really required here.
I'll use the React example, because I'm currently elbow-deep in it.
JSX is explicitly not 'HTML in JS' or 'JS in HTML' or anything else like that. It doesn't (or at least, shouldn't) run in the browser. It's only a sugary syntax for making it easier to write JS code that outputs HTML, and it exists because writing imperative code that outputs deeply nested trees is kind of annoying to write. Even better, everything is properly sanitised at the correct level; there's essentially no way to use unescaped data without explicitly trying to do so. That's a pretty great state of affairs.
I'm not going to be a cheerleader for all this stuff, because you're right that the correct tool should be used for the correct job. But frankly if you don't see the benefits of stability, modularity, and even security of using something like React versus patching together your own framework using `getElementsByClassName` then I think you're missing something.