Re:Why we chose Vue.js over React
by olegkikin on Sunday December 11, 2016 @04:52PM
(#13153550)
Wow. Do people consider this kind of coding acceptable now? We spent decades trying to separate templates, business logic, and inlined JS, and you managed to cram all three into a short snippet.
[ Parent
| on HN ]
Yes and this is a tired argument by now. The talk by Pete Hunt aptly titled "React: Rethinking best practices"[0] given in 2013 points out how separating templates and logic is merely a separation of technologies, not concerns.
Thanks for posting this, it was really interesting. Everyone who criticizes JSX should have watched it before doing so.
Whether to show a logout link or a login form is presentation logic, not business logic.
I've spent decades telling people that trying to keep logic out of templates is a waste of time. A useful templating language has variables, conditionals, and even functions. There's no reason not to use a real programming language.
There's no good automated way to enforce MVC. How is an automated tool going to know whether "show this number to two decimal places" is a model thing (inherent precision of the data) or a view thing (presentation choice)?
>> Whether to show a logout link or a login form is presentation logic, not business logic.
I would prefer keeping presentation logic, or any logic for that matter, out of the HTML.
Re:Why we chose Vue.js over React
by madeofpalk on Sunday December 11, 2016 @10:29PM
(#13155283)
It's actually no different to any other templating solution. Take a look at this[1] Mustache.js example and note the logic! At least JSX is honest about what it is.
Re:Why we chose Vue.js over React
by orange8888 on Monday December 12, 2016 @11:04PM
(#13164344)
I guess honest can be a nice way of saying more verbose, just like elegant is another way of saying more terse and simple for those who get it