4 ms·
"Vue.js is awesome. I’m telling this after having used React for more than a year in production software". I wish the author gave some mentions as to why that's
by buttminer 9y ago
"Vue.js is awesome. I’m telling this after having used React for more than a year in production software". I wish the author gave some mentions as to why that's the case (and why he's even using Ruby here).
I've been using React with MobX and Typescript for the past year in production and it's been treating me and my team very well. The framework feels quite invisible at this point.
- yaseer 9y agoIt's probably opening a can of worms to begin the JavaScript Framework comparison in that blog post. I'd imagine it would detract from their central aim of an integration guide. I also imagine this HN thread will quickly turn into a thread dominated by framework comparisons (it's the main reason I clicked through...)
- whitefang 9y agoMaybe it was not right to start on that note and I should have given some background. But trust me my intentions were not bad. Here is a post I've written on my experience using React https://www.classandobjects.com/tutorial/problems_with_react_single_page_app/ https://www.classandobjects.com/tutorial/problems_with_react... I would update the article to include this.
- heartbreak 9y agoI’ve been clicking through your blog for the last 20 minutes or so, and I’ve been really impressed. I’m itching to get home from work today and try out Vue with a Rails side project I’ve been working on. Thank you!
- whitefang 9y agoI'm so happy. I'll keep writing. :)
- vec 9y agoI'm not the author, but that quote lines up almost exactly with our experience. First, Vue shares most of the things that actually make React exciting. Component oriented, one-way databinding, virtual DOM, a first party Flux-inspired state management plugin. We didn't feel that we lost anything moving from React to Vue, and most of our existing components were trivial to port. What we gained, on the other hand, is a whole lot of developer comfort. Vue's template syntax can be read and manipulated by people who aren't primarily Javascript developers. Directives and filters eliminate quite a bit of boilerplate. Opt-in two way binding eliminates noisy setter functions without any loss of clarity. Getters enable the use of computed values as though they were raw data. There's no single killer feature, but taken together Vue just feels much more pleasant to use than React. React has the correct fundamental abstraction, but the actual API mistakes "small" for "simple". JSX, in particular, is trivial to explain and understand in theory, but in practice is often quite verbose and complex to use, as everyone who has asked themselves "how do I actually write an if/else block" has discovered to their dismay. Vue plux Vuex keeps the same conceptual simplicity and cleanliness as React, but it pairs it with a much larger, much more opinionated API that doesn't force us to reinvent every wheel we need.
- hashkb 9y agoYou don't mention mobx. If you haven't used it, you ought want to give it a look and reconsider your opinion
- rpeden 9y agoI enjoy mobx a lot, but I don't think it really address most of the points vec raised. The way I look at it, it's not a contest. If Vue is better for some developers and some teams than React, that's great! It's nice to have multiple good tools to choose from.
- nlperguiy 9y agoAccording to https://vuejs.org/v2/guide/comparison.html https://vuejs.org/v2/guide/comparison.html , vuejs is less verbose React + Mobx.
- 9y ago
- boubiyeah 9y agoYeah, depends what you value. vue is "easier" with probably less boilerplate at the cost of more magic and less type safety due to magic string templates (if using typescript like I love to) Definitely not a good tradeoff for me, but it is for some.
- k__ 9y agoNever understood this. How is Vue easier if we only consider components? How can it offer something simpler than functions as components?
- vec 9y agoBecause "simple" and "easy" are not synonyms. For example, Backbone is much simpler than React. React keeps a full virtual copy of the DOM in runtime and uses complex diffing algorithms to decide when and how to actually update the DOM in a manner which is entirely opaque to the developer. Backbone just does the DOM updates you tell it to, when and how you tell it to. And since Backbone is so much simpler, it logically follows that building an application in Backbone much be much easier than building the same application in React, right? Right? In Vue, a component generally consists of a raw JS object, an (almost) HTML template, and a block of raw CSS. The framework does some opaque but straighforward work to bind these three together into a single conceptual entity. This is indeed more complex, but the added complexity follows the grain of my preexisting intuitions. The end result, in practice, is components which have a clean internal structure and much less boilerplate. Slightly more complex, but easier.
- chmln 9y agoWe've used React and the ecosystem quite extensively at a company I worked at, and the main gripe we had were forms. Yes, there is redux-form but the fact that it exists seems like a drawback for React and Redux. Its APIs can be very clunky and not straightforward at all. setState(...) is not a good solution either as things can get more complicated with nested objects and such. In Vue, you don't even think about this problem. There's v-model which makes forms a breeze.
- whitefang 9y agoYes, form validation is a huge mess. I would say this would be one of the major reason, I even tried Vue for the first time.
- kendallpark 9y ago> "Vue.js is awesome. I’m telling this after having used React for more than a year in production software" Had the exact same experience. After Angular 1, Ember, and React, Vue is the first JS framework that I'm actually excited to use. My three biggest gripes with React are solved with Vue 1) better out-of-the-box experience (CRA is still not ideal), 2) single file components that strike a great balance between templating, logic, and styling, 3) Vuex is a slick Flux architecture with much less boilerplate than something like Redux. Vue is opinionated enough to give you a sane structure and guidance, but not so opinionated that you feel trapped in their domain and get lost in domain-specfic magic. You might say it's the goldilocks of frameworks. Doesn't introduce any radical new ideas, but MAN does it strike the right balance.