| My only point in mentioning apollo-tools is that DSLs are very powerful, and have the potential to make complex problems much simpler. SDL is a great example of is, as are vue templates. You may not appreciate the DSL, but, believe me, there are a lot of people who much prefer it. I'm specifically calling out designer type folks here. > I love how you could find exactly one thing out of a whole list of things that may be just ever so slightly better than JSX. It's not a question of "better" or "worse". It's a question of tradeoffs on spectrum of abstraction. I'm not here to bash JSX or react. But you apparently are, and I'm just trying to open your eyes a bit. When vue came out with JSX, I tried to force it on my team, and there are a serious backlash, to the point where I came to realization that the vue's major strength is actually the templates, and the magic. You may not like the magic, but a lot of folks do. As for your specific questions @ and : are just short hands. That's like saying: what's the difference between `map` vs `reduce` in my component to iterate over an array. They _can_ do the same thing, but map is shorter. In plain JS I can do `i = i + i` `i += i` or `i++` to increment an variable. @ just means "event handler". @click = "onClick"
: just means "use a dynamic value for this prop
{ } you can put any JS expression, with the plus that you don't have to litter your code with `this`. |
> with the plus that you don't have to litter your code with `this`.
"Littering code with this" is exactly how plain old vanilla JS works. Besides, "littering your code with this" very much depends on where your callbacks and variables come from... as in any old plain vanilla Javascript code. Because JSX is a paper-thin DSL on top of vanilla JS. Brilliantly and succintly described in this comment: https://news.ycombinator.com/item?id=17474370
In Vue you don't litter your code with this. You litter your code with hoisted variables and functions that are arbitarily hoisted into scope and injected everywhere. See my comment here: https://news.ycombinator.com/item?id=17471199 starting at "Of course. See inline comments."
The amount of gotchas and special syntaxes, and special cases, and the amount of moving part you have to understand to see where things come from and go to in Vue is insurmountably larger than in JSX.