2 min read

On React and Vue.

Stefan Bauer

This blog post is going to be a short one. I recently started tinkering around with React. I must say, I am happy that both Vue and React exist. I want to share my thoughts about why I feel this way.

The World Wide Web and especially programming communities seem to be very polarized a lot of times. I understand that having too many options can be a burden, but Vue and React have different strengths.

What Vue gets right

Vue's most obvious strength is templating and its syntax. JSX was a step forward, without a doubt. But Vue's single-file components steal the show here. Add comprehensive, easily readable documentation and sensitive progression, and you end up with a great framework. Also, Vue CLI lets you quickly start a project without copy-pasting code from various package documentations. That's different for React. Sure, there are many different templates for "create react app", but not all of them are of high quality.

And what about React

"Create react app" is great, though. You can quickly create an application with a stable setup and get going. What I enjoy about working with React is that you can write elegant code. Hooks are easy to read and reduce code duplication tremendously. Sure, Vue has the composition API, which is also enjoyable. However, it feels just a tad more clunky than React's solution. Also, React has better TypeScript support. That also got better with Vue 3, but React is closer to Vanilla JS than Vue in many cases. This closeness makes it easier to type things and apply patterns that you already know.

It is hard to recommend one over the other

As I have been working with Vue professionally for quite some years, I must admit that I'm openly biased. It is what I would always tend towards, if in doubt. Vue is easy to understand and setup. That makes it easy to onboard new team members. Also, Vue exhibits a high degree of backward compatibility. Forums are full of people complaining about yet another React Router breaking change. That is something that will not happen to you with Vue. Also, the CLI tool is a blast.

Still, React has quite some things going for it. You can quickly write small components. Also, there is less magic and the React team frequently comes up with great new concepts. Hooks, for example, blew my mind. Also, React's ecosystem is enormous and very mature. Vue has come a long way, but there is still some catching up to do.

Conclusion

Whatever framework you choose, it can never hurt to learn another one. I am happy that these two frameworks have finally unified large parts of the frontend community. I am looking forward to their next improvements.

Or maybe it is finally time to try out Svelte.