Vue vs. React vs. Angular
Which to learn? Which to use? Which is best?
Having gone deep on all three frameworks now, I’m going to give you a brief inside track on this ongoing debate.
It’s actually an extremely important question for every project, and for every developer:
Which frontend framework is best?
And by that I mean: Which should you learn? Which should you choose to use, if that choice is yours?
If we have data, let’s look at data. If all we have are opinions, let’s go with mine. — Jim Barksdale (?)
Before proceeding, you might be interested to learn how these frameworks are conceptually similar: https://medium.com/@matthewcarltyson/modern-ui-explained-in-4-paragraphs-and-2-pictures-2494042b3847.
Adoption and Viability
Stackoverflow and Git Stats
First, let’s look at adoption and viability. What I mean here is: are you adopting a framework that is going to undermine the mid/long-term viability of your project?
Here we get a look at each project with some longer term stats: Stackoverflow watchers and github stars.
Some interesting things jump out: VueJs doesn’t have very many watchers; Angular doesn’t have very many stars; VueJS has a lot of stars on github, more than React.
Any one of these projects seems to be fully viable. My chief question going into this data was: is Vue a long term viable choice?
It seems that Vue has a solid foundation of interest, even competing with React in Github attention.
Active Ongoing Usage: NPM Downloads
Get a look at the next data though, focusing on ongoing activity, where react crushes the competition.
No surprise that React is the most popular framework, but it is almost 6 times more popular than angular and vue combined, according to NPM downloads.
Clearly, there is a lot of interest in all three frameworks, but React is the most in use framework, by far.
Use-wise, I think all three frameworks are a safe choice, with the caveat that Vue’s checkins and management seems to be largely the perview of a single individual committer, and if that person ever looses interest, the framework might be in danger of being lost.
In terms of which framework to learn — it’s hard to argue with React’s dominance.
Here’s the image I wanted to use for the cover:
Beyond any statistics, the essence of the thing is how does it feel and handle when developing with the framework?
Angular 2+ was “designed from above.” By that I mean, a bunch of smart people sat down and decided what would make for the ultimate front-end JS framework.
In some ways, they succeeded, but ultimately, it doesn’t feel ergonomic to use the framework. That is the bottom line thing that puts Angular last.
Ultimately, you as a developer are inside a code-thought-machine that wants you to conform to its ideals and conventions.
On the good side, I think the wholesale adoption of JSX across the board is innovative and forward-thinking. Not only does it mean all the event handling needs are managed via the same mechanism, but the same well-built framework (reactiveX) and its learning can be transported to any other language you can imagine.
I’m still on the fence about the benefits of Typescript, but you will code and read typescript, if you use Angular. Another executive up-front decision.
The unwieldiness of defining, connecting and maintaining the very abstract and esoteric elements of an angular app will grind on you at every stage: the beginning, the build-out, and the seaworthiness of a large-scale app.
React’s strength is that it has organically grown up from in the world use. It has certainly undergone extensive growth, but its roots and ongoing bread-and-butter are that it is a real-world, someone-uses-it-for-work framework.
The component definition and interactions feel painless. Usually, things work the way you imagine they will, honoring the principle of least-surprise.
As long as you avoid unnecessary Redux usage, the handling of React with a large-scale application is as good as Vue, and better than Angular.
Performance-wise, react and vue seem to be neck-and-neck.
Although Vue and Angular also support to-native features and SSR, React seems to be keeping well ahead in terms of the simplicity in using these.
JSX has a good feel for me personally, in that is keeps related code and layout close together. Others have less happy experience with it. Overall, I put JSX as a positive for React.
While the overall feel of Vue is much smoother than Angular, it fails to match the elegance that React achieves. My biggest complaint is the handling of component interactions, which grows unwieldy for larger scale projects.
I’m a fan of the “normal JSON object as state” philosophy. Any time you can just use the language itself, a win for simplicity. However, there are edge-cases and caveats that ultimately mean you are dealing with a native-JSON-hybrid beast.
In a sense, Vue is somewhere between Angular and React, in being a moderation of Angular’s top-down design and React’s organically-grown roots.
Vue is a fine piece of engineering, to be sure. Ultimately though, is the satisfaction of using the underdog framework enough to beat React’s superior handling?
There are a number of quality plugins and kits for Vue (like Quasar and Vuex), enough to compete with the others.
Which to Use? Learn?
If the question is: which framework for learn? The answer is surely: whichever one the project you are working on/targeting for hire is using.
However, if its just a general question of which framework, we’ll have to go with React. It will provide you with the best-in-class and most-in-use learning, and it will teach many lessons that apply if you then need to learn the others.
Less clear, if you are a decision-maker and determining what framework to adopt.
I personally still have a soft-spot for Vue. I’d like to encourage the ferment of competing frameworks, and I don’t feel that Vue is technically so far behind React to make it a bad choice.
If I throw into the mix the greater stability of React’s future, I will probably be honest, and use React for future projects.
Angular I will avoid, to avoid the extra overhead of setup and ongoing development. I’ll use it if I have to, although I’ll miss RXjs.
‘Course these are my opinions and YMMV.