Remix.run Logo
recursive 16 hours ago

Neither react's JSX nor vue's template language are HTML. But rejecting vue's template on grounds that it's not HTML seems odd. React's JSX deviates from HTML in many ways. Like class vs className. XML self-closing vs HTML self-closing. onchange vs oninput. On purely aesthetic grounds, I can't understand how the react idiom of array.map() would ever be preferable to an affordance in the (non-HTML) template language for handling this normal standard thing that always happens.

apsurd 16 hours ago | parent [-]

it's not about feigning html purity it's the opposite. Why pretend we're using HTML when it's not? so with react it becomes a js flavor, jsx, which some people hate but it's very clear that it's a made up language IN real javascript.

edit: the mental model is instant: it's just javascript for reals. do anything you want in javascript using real js primitives. it's not about looking pretty, jsx doesn't. it's about not relearning basic programming primitives in a made up _markup_ language.

my issue with angular is it's neither real html nor any programming language. its made up pseudo-programming language for no other reason than it fools people into thinking "it's just HTML". that's my gripe.

recursive 19 minutes ago | parent | next [-]

JSX also fools people into thinking "it's HTML in javascript". I've heard several co-workers say this. JSX is a made up language as well. It's not javascript. That's why you need a build step to parse the syntax.

Angular and vue's template language are no more made up than JSX is.

markmark 16 hours ago | parent | prev | next [-]

Completely agree with you. Every time I see yet another template language adding some clumsy for-each loop syntax I sigh. Just let us use a normal programming language. As an example I give you every template system ever invented. Devops tooling is full of them.

recursive 16 minutes ago | parent [-]

Over the years, I've seen a few posts like this that seem to take it as a given that a loop in a normal programming language is better than foreach capability in a template language. Certainly enough times to believe that a significant group of people actually believe it's superior.

There's not a difference in capability of expression of the two models. It seems to be a purely aesthetic or comfort difference.

I guess different people like different things.

harry_m 15 hours ago | parent | prev [-]

Both the Vue template language and JSX are supersets of HTML. However, when it comes to integrating with CSS, JSX significantly worsens DX.