It’s pretty hard to get more “this is my opinion rather than a statement of objective fact” than this.
> I do not like JSX. It’s not worth talking about why. It’s not an argument I want to have.
Ok.
Um… well, it’s hard to have a discussion if you won’t talk about it…
…but, “code” templates allow autocomplete and type checking in a way that is an objectively distinctive superset of text templates.
It’s because they are code.
A template is (almost always) a weakly typed DSL. Written, ignoring all the history of language design… by a bunch of folk who don’t really know how to write programming languages. …and, they. Are. Bad. Not always… but often. …because writing a language is hard, and because (reason) you can’t ever use an existing template language. Oh no. This framework has to have its own unique one, because otherwise it doesn’t integrate tightly.
Do you like DSLs? Or do they just hide the complexity somewhere else? What if the DSL is bad, not orthogonal in its feature set, poorly implemented …but cute, and useful for a very very narrow use case.
Isn’t the main critique of react that it hides complexity by moving it from one place to another?
Don’t you think it’s a tiny bit ironic that all the other templates based languages with their custom template DSLs are doing the same thing?
Anyway; I think it’s fair to evaluate template languages as what they are: DSLs.
JavaScript is a better language than most template languages by a variety of metrics. Other languages are better than JavaScript, absolutely… but, never, have I seen a template language that is.
You can love declarative configuration all you want, but it’s very very difficult to argue that just because you can make a mess with procedural approaches that they are worse; because they are a strict superset of what’s possible using the declarative approach.
…so sure. I don’t but “JSX is easier to maintain”, but it’s distinctly superior in capability.