Live data from Hacker News

Why we chose Vue.js over React

pixeljets.com

181–190 of 267 posts

Re: Why we chose Vue.js over React

#181
post #179

The author says they don't like purity and immutability, because it limits their ability to "get stuff done". But in the long run you get many benefits, whether you have 1000 developers or one. Namely that a whole class of bugs will be eliminated and you can do quick reference comparisons to tell if something changed. Every time I go to look at Vue I can't stand the fact that it DOESN'T have JSX. I've used every temp…

You should check this: https://vuejs.org/v2/guide/render-function.html#JSX

Re: Why we chose Vue.js over React

#182
post #98
post #65

The arguments against JSX and React requiring many small components are very surface level and sound like "we couldn't figure out how to make it work for us so it must be impossible". 1. This was mentioned already, but, yes, you can use ternaries and boolean logic for simple conditionals (loggedIn && Logout || Login ) 2. When you need more markup, put them in an if-else statement in the same render function. render()…

I think your comment just proves the point of the original post. Your examples are still not good enough for me in terms of syntax and real work with html guys (specifically, has some quirks). I've gone through these things, and the pain&negativity about Angular 1 which translates to negativity to all template engines was also mentioned in the post.

JSX is awesome. It's just JavaScript, you can do whatever you want...

return ( { selected ? : null } );

or

let children = []; if (selected) children.push(); if (blah) children.push(); return ( { children } );

or

const bar = selected ? : null; return ( { bar } );

Re: Why we chose Vue.js over React

#183
post #65

The arguments against JSX and React requiring many small components are very surface level and sound like "we couldn't figure out how to make it work for us so it must be impossible". 1. This was mentioned already, but, yes, you can use ternaries and boolean logic for simple conditionals (loggedIn && Logout || Login ) 2. When you need more markup, put them in an if-else statement in the same render function. render()…

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

#184
With all the evangelism I've seen on HN about React, I have yet to see a cohesive post about the benefits that it provides that makes it worth the investment in learning.

Nor have I seen a seen a good review of tooling that provides a good path for someone who wants to try it out.

What I do see, are arguments that "it can do that too if you only knew how to use it!" That and a lot of sample code that embeds html within the code, which frankly looks like a delegation nightmare. (and scattered postings about documentation not being up to date)

You could downvote me. Or... you could point me to a helpful and up to date resource or recent posting that is actually helpful. Or better yet, write one.

Re: Why we chose Vue.js over React

#185

Earlier quoted context omitted.

Vue is a frontend framework . jQuery is a library , with a very specific goal (DOM access) What happened when you were using jQuery, is you created your own homegrown "framework" on top of it. Thats what you should be comparing Vue with, not jQuery.

I don't deny it. What surprised me was that Vue, a framework, was easier to learn than jQuery, a library. In my experience elsewhere it's usually the other way around. Like learning how to use Python's Requests vs. learning how to use Python's Flask.

Once again: apples and oranges

Re: Why we chose Vue.js over React

#186
post #65

The arguments against JSX and React requiring many small components are very surface level and sound like "we couldn't figure out how to make it work for us so it must be impossible". 1. This was mentioned already, but, yes, you can use ternaries and boolean logic for simple conditionals (loggedIn && Logout || Login ) 2. When you need more markup, put them in an if-else statement in the same render function. render()…

Not sure I understand your 3rd pattern, what does const {LoginForm} = this; do?

It is basically equivalent to `LoginForm = this.LoginForm`. It is called destructuring and is one of the nice conveniences of es6 javascript. Importantly you can also do this:

    var o = {p: 42, q: true};
    var {p, q} = o;

    console.log(p); // 42
    console.log(q); // true

Re: Why we chose Vue.js over React

#187
post #179

The author says they don't like purity and immutability, because it limits their ability to "get stuff done". But in the long run you get many benefits, whether you have 1000 developers or one. Namely that a whole class of bugs will be eliminated and you can do quick reference comparisons to tell if something changed. Every time I go to look at Vue I can't stand the fact that it DOESN'T have JSX. I've used every temp…

For Elm, there's elmx https://github.com/pzavolinsky/elmx

Re: Why we chose Vue.js over React

#188

Out of curiosity, one reason the author mentions (and I know, it's not his selling point) which I've seen others reiterate is that React's render() method doesn't support if statements. I know you can write something like the code below in React, so what exactly does that criticism refer to? function Home(props) { return ( HELLO Duis a turpis sed lacus dapibus elementum sed eu lectus. { (() => { if (props.location.qu…

To be fair, writing if statements in JSX is messier than it should be, but this is the fault of JavaScript and not JSX. If statements don't return anything, so we have to either create an immediately executed anonymous function (like you showed) or use a ternary operator. I'm pretty sure the author knows that you can put if statements in JSX but is frustrated that it requires boilerplate, which I think is a valid cri…

I can see that. I just wasn't sure, because every time a React debate gets kicked off, I inevitably see the "doesn't support if-else" thing get brought up, and having finally worked through a MWE with it, wasn't sure if it was just the (somewhat) convoluted syntax or whether I was missing something bigger.

Re: Why we chose Vue.js over React

#189
post #65

The arguments against JSX and React requiring many small components are very surface level and sound like "we couldn't figure out how to make it work for us so it must be impossible". 1. This was mentioned already, but, yes, you can use ternaries and boolean logic for simple conditionals (loggedIn && Logout || Login ) 2. When you need more markup, put them in an if-else statement in the same render function. render()…

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.

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

#190
post #34
post #11

One of the most impressive thing about Vue.js was the ability of the framework to enter a field saturated with dozens of options, that was becoming dominated by a well-resourced oligopoly (Angular, React), and still win over developers jaded from Javascript-fatigue. The give-a-shit factor from Evan (the creator) is extremely high and was key to its success. Inspiration for anyone building a product in an established…

The reason for its success is good documentation and simplicity. Anything like this aims to empower users, and get the fuck out of the way and let them do their work has a space no matter how crowded the market. Angular and React want you to do things their way and therefore get in the way, and then make you do a bunch of work to make things work their way. I have a PHP app that I rigged up using Vue.js. Took two day…

This, a thousand times this. I strongly considered Vue for a recent project but needed a bit more and went with Aureli, and now that it's out of beta I hope they keep up their rapid improvements to the docs to win over people with simplicity in getting up and running with Aurelia.
Post reply on HN