Live data from Hacker News

Why we chose Vue.js over React

pixeljets.com

171–180 of 267 posts

Re: Why we chose Vue.js over React

#171
post #102

Earlier quoted context omitted.

What does "want you to do things their way" even mean? Aren't you doing things a certain way by virtue of using a framework? Maybe angular/react is just making you do things in a way that you prefer not to, while vue.js is making you do things in a way that you find reasonable. For other people, it's the reverse.

If you have to do things in a specific way, then you are forced to learn that at the same time as you are learning the technology. Learning just vue on the other hand, is much easier when you can retrofit your existing knowledge into it. Then worry about the 'proper way' later when you have made your first few apps. I already have boatloads of knowledge, and whilst it may not be '2016', it's been good enough for the…

> To even get started in React, you need a babel, npm, gulp or webpack, node and a data-store of your choice

This is patently not true. You don't need any of that to make a React app -- you can just download the min.js files and get coding. React is perfectly capable of handling it's own state management and webpack/babel/npm are just to make your life easy. The problem is people follow full-stack, real-world tutorials like the one you linked without first just learning React.

Re: Why we chose Vue.js over React

#172
post #21

My man, a lot of the pain described in this article can be solved by Mobx: https://stackshare.io/mobx One of our engineers at StackShare[0] suggested it and it's fantastic. Mobx is very simple to understand and will make writing a "React" page a real joy again. Redux was way too complicated for what it gave, and just shot term after term after term at me that left me with a headache. I still don't understand Redux pr…

> Simple, scalable state management https://github.com/mobxjs/mobx It says "simple" but looks complicated. Any pointers? Is it because I don't know how decorators work it looks complicated?

Probably. Key things to know:

1. New JS decorator syntax

2. ES5 getters and setters

3. Observables

If you know those (and none are especially complicated), then I think the cognitive overhead of MobX is basically zero.

Re: Why we chose Vue.js over React

#173
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?

[deleted]

Re: Why we chose Vue.js over React

#174
post #111
post #86

Earlier quoted context omitted.

Save me the Rich Hickey talk. MobX is dead simple, it's a short write and here's how it works: - observables: add a getter/setter pair in place of the property - when it gets modified emit an event. - observer: when an observable getter gets called inside the `render` in React - listen to future updates and re-render. - computed: do the same thing as observer - but emit the value instead of rendering. All MobX does i…

Redux core is like less than 60 LoC. It can't possibly be more complex.

Without the decorator sugar, the core algorithm of MobX is also 60 LOC.

The author goes through it line by line here:

https://youtu.be/TfxfRkNCnmk?t=15m59s

It looked "magical" and tripped up my "too good to be true and I'll have problems later" sensor. Then I looked at that video and realised the idea is rather simple and brilliant.

Re: Why we chose Vue.js over React

#175
post #118

Earlier quoted context omitted.

I wouldn’t say React is “hacked together”. Perhaps you are referring to the React ecosystem? Facebook doesn’t build single-page apps with React, so naturally it doesn’t provide solutions for routing and similar concerns, so there is more churn as people are figuring this out together.

Could you expand more on "Facebook doesn't build single-page apps in React"? I hadn't heard that before.

Like, facebook.com isn't one big single-page React app. They use it for specific pages/features.

Re: Why we chose Vue.js over React

#176

Earlier quoted context omitted.

You are On. The. Money. When I first started dabbling in web programming a few years ago, I quickly learned about jQuery from SO while looking up common patterns to create the behaviors I wanted in the browser. But even accounting for my unfamiliarity with the browser paradigm, jQuery always rubbed me the wrong way because of how loosely structured it allowed you to be and the amount of leaky scope it encouraged. I f…

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.

Re: Why we chose Vue.js over React

#177
post #149

One small point to add here. Evan You is a pretty amazing individual, but he is no longer alone. There is a core team of six members. I know because the guy who got me interested in Vue.js, Chris V. Fritz, lives in the Lansing, Michigan area and is responsible for the excellent docs on Vue. I haven't been able to locate a list online but I know there's a core member in Paris and another one in Japan.

Other than Evan, could this be the list ? https://github.com/orgs/vuejs/people

You might be correct, heard that the core team would be expanding to 17. That list is more than 17 but the names that I recognize are on that list.

Bottom line is that Vue.js is growing up to better handle the popularity it's getting.

Re: Why we chose Vue.js over React

#178
post #68
post #27

Earlier quoted context omitted.

MobX is _incredibly_ simple. If you have a property you need observed - add a `@observable`. If you have a react component you want to update automatically, add `@observer`. Derive as much as you can using `@computed`. You can but shouldn't use `autorun` which monitors side effects. If you're already used to Vue it's very similar except it works with React. That's pretty much it - just clone a boilerplate - the API s…

I get the feeling that the terms "easy" and "simple" are being mixed up here. MobX is a lot more complex than Redux (core), as it tries to do a lot more things that are braided together as a package. In Redux you choose to bring in that complexity (reselect, redux-saga, etc) if necessary. "Easy" is subjective, "simple" is not.

> MobX is a lot more complex than Redux (core) [...] In Redux you choose to bring in that complexity (reselect, redux-saga, etc) if necessary.

I've dug quite a bit into Redux and I don't think that's really true. In particular I don't think you "choose" to bring in that complexity. Redux is inherently complex the moment you add async actions to it, which (in my view) any real Redux app will need. Something as simple as "fetching some data when you click a button" is a surprisingly elaborate process. Similarly, trying to map a large state tree (which any real Redux app will have) to a component tree is not easy. Libraries like reselect and redux-saga (or event redux-thunk) sprung up and became essentially universal because they address the inherent complexity of Redux.

I just don't think it makes sense to tease out a small chunk of the code a Redux app needs to function and say "look, this chunk is small!"; it's true but meaningless.

Re: Why we chose Vue.js over React

#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 template system you can think of and they always fall apart when things get hard.

JSX is basically JavaScript but a much easier and nicer syntax (basically HTML).

You get the same flexibility with Elm, but even there you don't get the nice JSX syntax:

ul [class "grocery-list"] [ li [] [text "Pamplemousse"] , li [] [text "Ananas"] , li [] [text "Jus d'orange"] ]

The one criticism I happen to agree with is certain aspects of using forms in React. Checkboxes and radio buttons are pretty buggy and stupid. Kind of unacceptable at this point.

Re: Why we chose Vue.js over React

#180
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…

If I remember correctly the latest version of Vue.js does support JSX.
Post reply on HN