Want some programming help? [close]

Angular vs React vs Vue.js

Introduction

Recently I needed to take my front end development skills to the next level. Whenever I needed to build a web interface, it was simple enough to use Bootstrap and the jQuery that came packaged with it. This worked fine when the templates were being rendered server-side using templates like with Django, Flask, WordPress, etc.

The better way to make web applications these days though is to have a separate REST API running the back-end, and then have a front-end that consists only of static HTML, CSS and JavaScript that interact with the API using AJAX calls.

I decided to take the time to learn Angular, React, and Vue.js enough to form an opinion and understand the benefits and drawbacks of each one. This is my comparison and conclusion. I chose Angular and I will explain why.

For reference:

Angular wins

For me, Angular is the preferred solution.

I like the all-in-one package. You don't have to use everything in the framework, but you know they are available, they work well and play well together, they are all tested together, and you can find help in the same place and they are all supported equally.

I don't want to try out every possible combination of libraries to eventually compose my own framework. I want a framework. Angular is that. It comes with the components, routing, shared state with services and dependency injection, form management, animation, HTTP, etc.

I have been using Angular for a fe wmonths and have not had to add a single dependency outside of the framework yet. Angular wins for the same reason I prefer Django over Flask for significant applications, it's a complete toolbox.

When it comes to finding other developers or getting help, it's much easier to find another Angular developer, than it is to find another developer who is familiar with hodgepodge of libraries from different providers wired together in a jerry-rigged framework.

What about Vue.js?

Vue.js for me comes in second place. It has less available than Angular, but it has the important things: routing and shared state. This is a very nice sweet spot because those pieces together make up a lightweight framework that sits right between Angular and React. With Vue, you still have to add your own HTTP library if it is needed.

I actually quite liked Vue, and I would like to use it on a significant application to get an even better idea of how it feels versus Angular.

Why not React?

React was the fastest to learn and also the most bare-bones of the three. It is more of a library that you would put in your own framework composed of complementary libraries. React alone is not enough for a full app. For shared state you need to introduce Mobx or Redux which is just another decision to add to the complexity. Then you need to find the right HTTP library for you, router, and so on. As someone who is not a JavaScript fanatic that already has experience with all of those things, I didn't want to spend more time researching and comparing libraries to figure out which combination would work best for me.

I liked how opinionated Angular was and how it came with all the tools I needed in comparison to React leaving me wondering what combination would be the best long term. It is like Django vs Flask. It depends on what you want and I want the entire framework not just a single component of a framework.

I also didn't like JSX, it reminded me of the bad days of Drupal 6 where HTML was embedded in the return statements inside plugins making it really ugly and difficult to debug. It also required an additional step of finding a plugin for my editor to recognize that it should be treated as JavaScript inside the string.

But, React Native!

In the past React Native was a strong reason to choose React, because the knowledge would translate very efficiently to writing mobile apps with React Native.

React Native is no longer a unique player. With NativeScript you can write the same kind of cross-platform mobile application using regular JavaScript, TypeScript, Angular, or Vue.js, the same way you do with React. It also does not involve the third party Expo or their build tool chain.

I tried both React Native and NativeScript and personally I prefer NativeScript. I tried it with Angular, and it worked just like normal except the templates have different components, the same ones React Native uses.

Conclusion

Hopefully it goes without saying, but all three of these options are great choices. If you are a CTO or architect trying to make a decision, I would consider any one a safe decision, but my preference and recommendation is Angular. I encourage you to comment with your own thoughts and experience!

Advertisement