Live data from Hacker News

Vue.js vs. React

vuejs.org

181–190 of 486 posts

Re: Vue.js vs. React

#181
post #132

We moved away from React to Vue about 8 months ago and everyone on the team is a lot happier. First reason is we hate JSX. It forces you to write loops, conditionals, etc, outside of the markup you are currently writing/reading. It's like writing shitty PHP code without templates. It also forces you to use a lot of boilerplate like bind(), Object.keys(), etc. Another problem with React is that it only really solves o…

> First reason is we hate JSX. It forces you to write loops, conditionals, etc, outside of the markup you are currently writing/reading. It's like writing shitty PHP code without templates.

You could theoretically write some template components and "avoid" javascript altogether. I wonder if anyone has actually done that?

JSX isn't perfect, but I find the dirty things about it can be mitigated by keeping your components small, and if that isn't possible then keeping the render function small by breaking it out into several functions that return pieces of your markup. Writing small functions is sound general programming advice, but it seems especially true with JSX/React.

Re: Vue.js vs. React

#182

Earlier quoted context omitted.

i was in the same boat as you regards to syntax but in 10 mins you will grasp everything about vuejs. of all the frameworks, vuejs has the simplest syntax to learn. its no where as complex as angular and way more elegant. also beats jsx in terms of making your code more cleaner and prettier. im never going back to jsx.

> i was in the same boat as you regards to syntax but in 10 mins you will grasp everything about vuejs. Not sure about the original poster, but I prefer react/jsx not because it's simpler, but it's more powerful - it's a simple extension to a full programming language. You can do whatever you want with it.

perhaps you might be thinking that you can't run raw js with vue? well you get js and more.

it's just less coding and boilerplate if anything.

vue also optimizes your reactive codes and is faster in many cases. react can get pretty slow and heavy if you don't know what you are doing and trying to debug those situations can get pretty hairy. otoh, i've not seen any similar issues with vue. what vue does with the bindings is really neat.

Re: Vue.js vs. React

#183
post #108

I've built semi-large applications in both Vue.js and React. I like both but prefer React. For me Vue.js is like a light-weight Angular 1, in a good way. It's very intuitive and you can start working immediately. It does however easily end up in confusion about where the state lives with the two-way binding. I've run into a lot of implicit state changes wrecking havoc. The declarative nature of React definitely wins…

working anything with loops and conditionals, Vue is way nicer than JSX all the way around, especially the more complex it gets with *-level nested json data trying to mix in with conditional portions of the view, and even saving reactive data back the scope of the loop, etc. i'm not sure why you'd think otherwise. JSX code with many loops and conditionals can start look incredibly ugly pretty fast. if you can provide an example, we can compare between the two to see which is nicer.

Re: Vue.js vs. React

#184
post #132

We moved away from React to Vue about 8 months ago and everyone on the team is a lot happier. First reason is we hate JSX. It forces you to write loops, conditionals, etc, outside of the markup you are currently writing/reading. It's like writing shitty PHP code without templates. It also forces you to use a lot of boilerplate like bind(), Object.keys(), etc. Another problem with React is that it only really solves o…

> First reason is we hate JSX. It forces you to write loops, conditionals, etc, outside of the markup you are currently writing/reading. It's like writing shitty PHP code without templates. You could theoretically write some template components and "avoid" javascript altogether. I wonder if anyone has actually done that? JSX isn't perfect, but I find the dirty things about it can be mitigated by keeping your componen…

Yes, there is a project called react-templates by Wix that does that.

We used it, but once you start using libraries like that one or MobX, why even use React at all?

Re: Vue.js vs. React

#185
post #108

I've built semi-large applications in both Vue.js and React. I like both but prefer React. For me Vue.js is like a light-weight Angular 1, in a good way. It's very intuitive and you can start working immediately. It does however easily end up in confusion about where the state lives with the two-way binding. I've run into a lot of implicit state changes wrecking havoc. The declarative nature of React definitely wins…

I love single file components. I used Polymer before React and that is the thing I miss the most. I've also been using CSS-in-JS for the same reason. I landed on JSS for now, but I'm hoping we'll see a solid scoped CSS solution soon.

Re: Vue.js vs. React

#186
post #19

I've used both. What makes me pick Vue in the end is the fact that there is no compiler needed, no jsx and all the non-sense that goes with that. If you want a full blown huge application to last years, then go Angular... Although who knows if Angular will be there in 5 or so years. There is no perfect library/framework but I love Vue because Vue does exactly what it says on the tin.

No application lasts "years" nowadays, so I'd suggest not go "go Angular" simply because it's Angular. The modularity and speed-to-productivity of Vue is the reason I choose it. Plus, the community is quite supportive; always nice.

I've been working on a large web app (SaaS, so you won't have heard of it and can't try it out) for the past 5 years, and it's one continuous history codebase using Backbone for UI. It's not going to get rewritten any time soon. I'd expect it to still be using Backbone or something very similar (perhaps switching out some rendering subtrees for Vue or React) in another 5 years.

Re: Vue.js vs. React

#187
post #19

I've used both. What makes me pick Vue in the end is the fact that there is no compiler needed, no jsx and all the non-sense that goes with that. If you want a full blown huge application to last years, then go Angular... Although who knows if Angular will be there in 5 or so years. There is no perfect library/framework but I love Vue because Vue does exactly what it says on the tin.

I've never seen a SPA last "years" without some eventual rewrite or major change. The only sites I see last year are serveres rendered ones or very simple ones.

You probably don't see them because complex web UIs aren't always consumer-facing. The ones you're familiar with are probably maintained by large corporations rather than specialist companies, and can more easily afford rewrites.

Re: Vue.js vs. React

#188
post #127

One of the biggest things React has going for it, other than being maintained by Facebook and having a much larger community, is React Native. You can learn one web framework and now also make compelling, real native apps. To me those are both deal makers. Surprised I haven't seen this mentioned more in the thread.

Or you can just compile any HTML5 mobile app using Cordova and in 99% of the cases your users won't notice any performance difference between native-app and HTML5 app.

Re: Vue.js vs. React

#189
post #46

You'll see quotes in this thread like "The demand for both React and Vue.js is growing tremendously" thrown around. It's good to check out npm install stats to get an unopinionated comparison. https://npm-stat.com/charts.html?package=react&package=vue&p... In reality, React is downloaded roughly 4-5x more than angular and 7-8x more than Vue. In August so far, React has 75% market share among these three libs. Interes…

Another chart worth viewing:

https://www.hntrends.com/2017/july.html?compare1=React&compa...

Hiring is a lagging indicator, but I see React hitting a plateau the way angular did. I see Vue is on the cusp of takeoff. Time will tell if it fails to launch, but I'm seeing more interest in Vue at meetups than React.

I think a lot of this has more to do with React's state management than licensing. One of the react developers said it best. Paraphrasing;

Everyone stopped saying React is fun after Redux.

Re: Vue.js vs. React

#190
post #108

I've built semi-large applications in both Vue.js and React. I like both but prefer React. For me Vue.js is like a light-weight Angular 1, in a good way. It's very intuitive and you can start working immediately. It does however easily end up in confusion about where the state lives with the two-way binding. I've run into a lot of implicit state changes wrecking havoc. The declarative nature of React definitely wins…

working anything with loops and conditionals, Vue is way nicer than JSX all the way around, especially the more complex it gets with *-level nested json data trying to mix in with conditional portions of the view, and even saving reactive data back the scope of the loop, etc. i'm not sure why you'd think otherwise. JSX code with many loops and conditionals can start look incredibly ugly pretty fast. if you can provid…

I have a JSX example. It isn't React, but it's Mithril which is similar: https://github.com/brlewis/brlewis.github.io/blob/master/201...

Blog post accompanying said example: https://medium.com/front-end-hacking/how-it-feels-to-learn-j...

I'd be interested to see the equivalent vue.

Post reply on HN