News for hackers. Stuff that matters.
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.
Re:Why we chose Vue.js over React by kentor on Sunday December 11, 2016 @05:21PM (#13153735)
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.

[0]: https://www.youtube.com/watch?v=x7cQ3mrcKaY

Re:Why we chose Vue.js over React by ggregoire on Sunday December 11, 2016 @05:57PM (#13153938)
Thanks for posting this, it was really interesting. Everyone who criticizes JSX should have watched it before doing so.
Re:Why we chose Vue.js over React by brlewis on Monday December 12, 2016 @09:14AM (#13158104)
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)?

Re:Why we chose Vue.js over React by talmand on Monday December 12, 2016 @11:20AM (#13159179)
>> 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.

[1]: https://news.ycombinator.com/item?id=13153298

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
Re:Why we chose Vue.js over React by EugeneOZ on Sunday December 11, 2016 @06:22PM (#13154110)
Agree. Looks like those who haven't suffered from it, can't live without this suffer. They just need to have this experience to be able to understand downsides.