logoalt Hacker News

snemvaltstoday at 6:59 AM1 replyview on HN

JSX is a very thin layer of templating logic inside JS. Meaning you have all the language features available while templating. Some arbitrary JS can result in templating.

Vue's DSL is whatever language the developer implemented. Which is probably not enough, depends how much effort they put into it and how good they are in language design. Given that they cargo cult HTML tags to organize components in a pseudo-familiar but not-valid-HTML way, I don't have much confidence in their language design skills.

I'd take the former any day.


Replies

Lukas_Skywalkertoday at 8:04 AM

While I understand the advantage of using the built-in language features (and I know why it is required to be done that way), I still think using

    {enable && <Form />}
for conditional rendering, or

    {collection.map(x => <Item x={x} /> }
for looping are not the most obvious choices. If you ask people how conditionals and loops are written in JS, you will get 'if' and 'for' or variants of 'while'. So I get where the v-if and v-for are coming from.