Angular vs Vue vs React: choosing the best framework in 2020

Tags: vue, angular, react, javascript
Published: 2020-06-25 19:01:43

Front-end frameworks are growing in popularity as they allow individuals and companies alike to build complex applications in reduced time. These technologies continue to evolve and have revolutionized the world of web development. Today, we will compare three popular front-end technologies: React, Angular, and Vue. Today, we will be breaking down each framework so that you will get a feel of which one feels right for you. 

**We will cover the following:**

- [Introducing the frameworks](#intro)
- [Advantages and limitations](#pro-con)
- [Framework philosophies](#philosophies)
- [Popularity](#popularity)
- [Syntax](#syntax)
- [Other factors for consideration](#other)
- [Wrapping up and Resources](#wrap-up)

<br>


> Start learning front-end development for free with Educative's COVID scholarship. 
> [Claim your free COVID Scholarship](https://www.educative.io/covid-scholarship)

<a name="intro"></a>

## Introducing the frameworks

If you’re in the world of web development, I’m sure you have heard the terms “front-end” and “back-end.” If not, we’ll go over them quickly. The **front-end** is all the parts that users interact with and see on the website. The **back-end** is the “behind the scenes” area that provides business logic and functionality to the site.

As the web has evolved over the years, complexities in how we build web applications continue to grow. Organizations and individuals have developed tools, libraries, and frameworks for others to use that speed up and simplify the development process. A **JavaScript framework** (or library) helps developers create modern applications called single-page apps (SPA). That’s the case for many front-end JavaScript frameworks like React, Vue, Angular, and more. 

Technologies like React, Vue, and Angular offer tools and code that allow users to create powerful web applications without having to do the grunt work. These frameworks significantly cut down development time and decrease the overall headache. So, if you looking to be hired as a front-end developer, it’s vital that you master a front-end framework.

<br>

### Histories of Vue, React, and Angular

Today, we will be comparing three very popular and most wanted front-end frameworks of 2020: React.js, Vue.js, and Angular. These are some of the most popular frameworks that allow developers to build complex and modern user interfaces on the web. Let's briefly go over their histories.

* **React:**  React is an open-source JavaScript library built by Facebook in 2013, which uses React internally. React is used by large companies like Facebook, Twitter, Whatsapp, Instagram, Microsoft, Slack, Asana, Airbnb, and more.

* **Angular:** Angular was developed by Google in 2010. It’s important to note that Angular is a TypeScript-based JavaScript framework. If you want to read more about TypeScript and how it’s different from JavaScript, check out our [TypeScript Tutorial article](https://www.educative.io/blog/typescript-tutorial). In 2016, Google released Angular2, which offered a substantial shift. Angular is used by organizations like The Guardian and Weather.com.

* **Vue:** Also also known as Vue.js, Vue is the youngest out of the three. It was developed by ex-Google employee Evan You in 2014 and has increased in popularity over the past few years. Though not as popular as React, it’s still used by large companies like 9Gag, Alibaba, and Gitlab.

<br>

<a name="pro-con"></a>

## Overview of advantages and limitations

Making technology decisions on frameworks can be hard. It’s important to note that there is no *best* framework. All three have their strengths and weaknesses, and at the end of the day, it comes down to which one best suits you. When determining your framework of choice, you should consider a variety of facotrs that we'll discuss today. However, most importantly of all, choose the one that you like. That being said, let's dive in! 

<br>

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/asi17yrf3yenb4gc9k8k.png)

### React

**Advantages**

- Easy to learn since it is lightweight and offers a simple JS design using a syntax that combines HTML and JavaScript. React also offers great documentation, which is something to consider for initial learners.

- Fast due to React’s Virtual DOM implementation and rendering optimizations.

- Top-notch Progressive Web App (PWA) support, especially with its `create-react-app` template generator. 

- React implements functional programming with components, which allows for reusable code, creating a modularized design. This makes apps easier to maintain and build upon, allowing for complex infrastructure to be more easily developed and scaled.

**Limitations**

- React is an incredibly un-opinionated technology, which means that developers have to make their own design choices.

- React technology is constantly updating, so sometimes it can be difficult to keep with the latest documentation.

- React uses JSX which can be a learning barrier to some newer developers, though it does have its own benefits, 

<br>

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qmo8rzxpc31882vlt33g.png)

### Angular

**Advantages**

- Angular uses TypeScript, which provides great support for type checking and other external tooling.

- Angular is supported by Google, which means its backed by a dependable organization. They work with detailed documentation and a large community, making it a reliable framework to learn.

- Angular-language-service allows for autocomplete inside of component external HTML template files, allowing you to speed up your development.

**Limitations**

- Angular offers a variety of different structures like Injectables, Components, Pipes, Modules, and more. This makes it harder to learn in comparison to the Vue and React, which focus on the component.

- Slower performance because it works with the real DOM, though it can be tackled using the ChangeDetectionStrategy, which helps manually control the rendering process.

<br>

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/n0oh0igrgsgph4e1kt59.png)

### Vue

**Advantages**

- Vue offers detailed documentation, which aids in the already low learning curve for developers. You can make powerful single-page applications just with knowledge of HTML and JavaScript.

- Vue is used for building single-page applications and more complex web interfaces. Furthermore, Vue applications integrate easily into an existing infrastructure with no negative effect on the system.

- Vue takes advantage of the virtual DOM, making it faster than Angular. Also, Vue is small, so its speed and flexibility are optimal, allowing for better performance in comparison to the other frameworks.

**Limitations**

- Vue offers fewer resources than React and Angular as it is relatively newer and has a smaller market share. This means that knowledge sharing and support are less available.

<br>

<a name="philosophies"></a>

## Framework philosophies

### React

**React** provides a lightweight library to render elements to the DOM and control them in an effective manner. A core functionality of React is building components and sub-components, which you can understand as UI pieces on a web app. React also gives you a bunch of tools that help you better define how you want your components to be rendered. React also offers third-party packages like [React Router](https://www.educative.io/blog/react-router-tutorial), a dynamic, client-sized routing library for building SPAs that render without refreshing the browser. 


### Angular

Angular offers the most functionality of the three frameworks, allowing you to control the user interface, handle user input, validate forms, routing, state management, testing, PWA capabilities, and more. Unlike React, Angular focuses on providing you a full collection of tools to use. 

It’s also important to mention that Angular has an official CLI, which makes it easier to manage Angular projects to add dependencies and deploy. Because Angular uses the real DOM, its performance to load a dynamic web application is affected.

### Vue

Vue is like a middle ground between Angular and React. It offers more tools than React, but fewer than Angular. It offers built-in state management and router. However, it does not feature HTTP client functionality or form validation. Vue uses the virtual DOM for faster and bug-free performance.  Vue focuses on building user interfaces and creating reusable components. 

> ### So, who's the winner for philosophy? 
> There doesn't appear to be a clear-cut winner in this category, as each framework has different pros and cons in terms of frameworks. React does seem to offer more tools and add-ons, but if you don't like working with the virtual DOM, then Angular is the best bet.

<a name="popularity"></a>

## Popularity

When considering a framework to use, popularity matters for a few reasons.

- Finding a job is easier if you know a popular framework, as companies are more likely to use them and seek candidates with relevant experience. 

- Popular frameworks are less likely to disappear or become irrelevant down the line.

- Popular frameworks are supported by big communities that can produce 3rd party libraries and tools to provide more features.

- You will also find more help through external documentation and tutorials.

So, we know that Vue, React, and Angular are popular frameworks. But just how popular are they? And which do companies look for on your resume? To answer these questions, I looked at four things to evaluate popularity: Google Trends, NPM downloads, StackOverflow, and common job offerings.

<br>

### Google Trends

Based on the graph below, it seems that in 2020 React is the most popular worldwide, while Vue and Angular rank similarly. It's important to note that Google Trends searching does not equate usage in the industry, but it does give us a sense of which frameworks are on the rise and which people are more curious about. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/n0oh0igrgsgph4e1kt59.png)

Below, if we look at the US specifically, the story is similar, though Vue did not see a rapid drop off in popularity as it did worldwide. While this does seem to suggest that React is the most popular, it simply shows search terms. There are other ways to determine popularity, such as based on actual usage. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2w9y2088rlflqpqkiikr.png)

<br>


### NPM Downloads

With NPM downloads, we get a similar story. React gets about 5 times more downloads than Vue or Angular, suggesting that it is more commonly used amongst developers. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2w9y2088rlflqpqkiikr.png)

<br>

### StackOverflow survey 

The StackOverflow survey tells us a lot about trends and popularity in the market. According to the 2020 StackOverflow survey, React ranks 2nd for most popular framework; Vue ranks 7th for popularity, and Angular ranks 9th. Keep in mind, this includes frameworks of all languages, not just JavaScript. For most wanted frameworks, React ranks 1st, Vue ranks 2nd, and Angular ranks 3rd. Clearly, these frameworks are hot in the market for 2020! On top of that, TypeScript ranks well for the highest salaries worldwide, coming in at $57k annually. *The chart below shows the top four most wanted frameworks of the 2020 survey.*

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/byao5vgcr6p2opmu7crf.png)

<br>

### Job offerings

Finally, let’s take a look at job offerings. When querying on Indeed in 2020, React appears in around 42k software development job offerings; Angular appears in 10k jobs, and Vue appears in just under 3k jobs available. When searching through Linkedin, the story was the same with React ranking first, followed by Angular and Vue.

What this seems to suggest is that React is the most popular, sought-after front-end framework. In terms of developer popularity, it could be argued that Angular and Vue are at a similar state currently, though Angular has significantly more job offerings in the United States. It should be noted that Vue is incredibly popular in places like China.

<br>

> ### So, who is the winner for popularity? 
> Based on this research, React appears to be the most popular in terms of the market and offerings overall. React seems to be a reliable framework for US developers looking for jobs at big tech companies, and it is the most competitive at the moment. But, as I suggested above, this also largely depends on where you want to work. As you search for career openings in your country, look carefully at tech stacks and job descriptions to see what they expect from a front-end developer.  

<br>

<a name="syntax"></a>

## Syntax

### React
React uses JSX, which combines JavaScript with HTML. Just like with TypeScript in Angular applications, JSX gets compiled into regular JavaScript code once you build your project. Here is below code snippet of a Hello World component in React.

```js
import React from "react"

function HelloWorld(props) {
  return <li>Hello World</li>
}

export default HelloWorld
```

As you can see, you can create components with React through JavaScript functions. JSX is usually something that you either totally love or completely dislike. So, it's vital that you play with React a little before you totally commit to it.

<br>

### Angular

Angular applications use TypeScript, a superset to JavaScript. Angular projects will compile the TypeScript code into browser-compatible JavaScript code. You can write "components" like this and Angular will take control behind the scenes to manipulate the real DOM. Take a look below.

```ts
import { Component } from '@angular/core';

@Component ({
   selector: 'my-app',
   template: `<h1>Hello World</h1>`,
})
export class AppComponent{}
```

<br>

### Vue

Unlike React and Angular, Vue uses normal JavaScript. For newcomers, it can be a bit easier to learn because you don't have to learn something completely new like JSX or TypeScript. Below is a snippet of a Hello World app, which may look more familiar to you if you're new to JavaScript.

```js
new Vue({
  el: '#app',
  data: {
    message: 'Hello Vue.js!'
  }
})
```

<br>

> ### So, who is the winner for syntax? 
> You might be wondering which syntax is the best to work with. The answer is that there is no *best* syntax - only one that works best with you. For example, some developers love JSX with React. Others really enjoy using TypeScript and Angular's opinionated structure. Some developers are a fan of Vue because you only have to know JavaScript. I suggest you explore each library or framework and choose the one that resonates most with you.


<br>

<a name="other"></a>

## Other factors for consideration

Some other factors you might be wondering that were only briefly mentioned are performance and learning curve.

- **Performance.** While performance is a valid concern, you shouldn’t have to worry about it for any of the three frameworks, as they all offer great performance. All three frameworks are fast when using starting time and runtime as metrics. It should be noted that Angular apps are larger than React or Vue apps, but this shouldn't matter unless you working with a very small application.

- **Learning Curve.** In terms of the learning curve, Vue is the easiest to learn because it doesn't require any special setup since you simply need to import the Vue Library. Another reason is that it only uses JavaScript and HTML, whereas React and TypeScript require additional Syntax learning for JSX and TypeScript, respectively.

<br>

<a name="wrap-up"></a>

## Wrapping up and Resources

Nice job! Now, you should have a good overview of the three popular front-end technologies: React, Angular, and Vue. However, the learning doesn't stop there. It's time to go more in-depth into each framework so that you can determine the one that best suits you. As I mentioned, it's important to play around with each framework before committing to it entirely. Take a look at other projects, source code, and online courses to get some hands-on experience. 

* If you're looking to learn more about React, check out Educative's [React for Front-End Developers Track](https://www.educative.io/track/advanced-front-end-developer).

* Want to learn more about the basics of web development? You can learn more through the [Become a Front-End Developer Track](https://www.educative.io/track/beginning-front-end-developer).

<br>

### Continue Reading

- [Comparing the best Front-end JavaScript Frameworks](https://www.educative.io/blog/compare-best-frontend-javascript-frameworks) 

- [Getting started with React and TypeScript
](https://www.educative.io/blog/react-and-typescript)

- [Build an app from scratch with Vue.js
](https://www.educative.io/blog/build-an-app-from-scratch-with-vue-js)

- [The Roadmap to becoming a Front-end Developer](https://www.educative.io/blog/roadmap-to-become-a-front-end-developer)