DEV Community


Discussion on: Vue or React?

ghamadi profile image
Ghaleb Author • Edited

Ok, as I said before, I have not used React yet. But I think many of the arguments laid out here are invalid.

if you use React you get the cool things first.

This would only be a plus if both codebases in general are equally maintainable in structure and syntax. If the popular claim is that Vue is easier to learn, more structured, and easier to maintain, then getting the cool features first doesn't matter; especially if the current features do a good job already.

Most important is React components are far more flexible you write just JavaScript so no v-if stuff that forces you just to unlearn JS

v-if and v-for did not force me to unlearn JS. Their use is very intuitive. In fact, I appreciate the fact that the HTML and JS parts are well separated in Vue. I think this is a highly subjective point, and not a deal breaker when choosing a framework.

In Vue you need to duplicate yourself so often because you need to register components before using it which is crazy

That is a false statement. You either register a component globally to avoid importing it in multiple other components, or you don't register a component and you import it only where needed.

Finally, when you speak of NextJS you should compare it with NuxtJS, not plain VueJS.

I am not saying Vue is better, I am simply pointing out the flaws in the arguments presented.

ryansolid profile image
Ryan Carniato

If the popular claim is that Vue is easier to learn, more structured, and easier to maintain, then getting the cool features first doesn't matter; especially if the current features do a good job already.

Is this the popular claim? Easy to learn, completely. Vue likes being the progressive framework. Vue's like "All you need to do Web Dev are these couple things don't worry about the rest, and as you need to know more we will direct to your next level". That might mean changing your mental model slightly and introducing new APIs and capabilities. It's very welcoming. It's also leveled which works well with how we learn.

React's like "Here are some primitives, here is a philosophy, now go out into the world". You get the basics and never need to come back until they introduce a new feature. I think there is a lot of preference in what is a better pattern for each person/team.

But saying Vue is easier to learn seems reasonable, even if I think if your goal is to become an expert React might be easier from the onset because they don't waste your time. React is also simpler architecturally. I mean there is fiber, but if you were to write a clone from scratch React's model has less moving parts generally.

More structured? Easier to maintain? ... I mean there is a reason Vue 3 exposed their reactivity in the composition API. I imagine this was to address limitations in that structure. As way to improve expressiveness and composability. Those probably make Vue less structured than before and possibly not as easy to maintain. It's a good tradeoff. But I don't think these are particularly compelling arguments for either library.

There is an argument on less reliance on 3rd party libraries means more stable code base, but there is an equally apt argument that easier ability to swap out pieces leads to better long term maintainability. Not that you'd could do this in Vue as well, just you end up in the same place if official vue-____ doesn't solve your needs.

React does get the cool things first, but that is double edged. They are doing the R&D work and the early adopters are paying the price. Vue waits until things are settled usually before dipping in. Directionally being innovative might be something you appreciate in your tools, but most people are looking for stability. But it does make for the argument that if only one of these libraries was to survive I'd take the innovative one. Not that there aren't small innovations in Vue. They just mostly play it safe and their community thanks them for it. But I think it's still a checkmark on the React side.

The rest of the original arguments I agree are a bit out there. So much easier if people on both sides just understand that JSX vs v-for or what not are conceptually close enough that this comes down to syntax mostly. JSX side can claim theirs is more flexible (and it is) but you can always achieve the same things in Vue-like templates albeit with a bit more work. The Vue side will claim their static templates are better for compiled analysis/performance. But not in any meaningful way as the fastest UI frameworks use JSX or HyperScript.