React v/s Angular: Yet Another Opinion

Shashwat Agrawal
tech@iiit-gwalior
Published in
8 min readDec 4, 2021

--

Thanks to Canva Team

INTRO

When it comes to developing a complex web application, managing it with Vanilla Javascript is not a healthy practice. Though you may even use simple HTML, CSS, JS to build a website, it is next to impossible as this will push your efficiency to the minimalist. Thus, there are high chances to use a library or any framework that can support your way of programming. Picking up one from a bunch of powerful frameworks is indeed a hectic task. And pretty much that’s why you’ve reached this article.

If you are a developer who develops complex web applications, that means you might know how important it is to choose a framework, to ease the struggle. There are various web frameworks like React, Angular, Vue, Ember, and the list is not gonna end. Majorly developers use React or Angular. Why so?

Why are only React & Angular the most popular ones? Which one should you choose? What are their benefits & harms? And many such other questions. Also, there’re plenty of articles over the web discussing React vs Angular. So, why do we need yet another one? Let’s discuss all of ’em in detail.

What’s up with React?

React.js - ACool Dude!

React is developed by Facebook. Being a Facebook product, it is maintained by its community and thus prominently used in the daily app we use including WhatsApp, Messenger, or Instagram. 2013 was the year of its existence. It’s been around 8 years, the developers are using it, though it is not very new, its popularity seems to be on fire in the 20s. Many other big companies including Airbnb, Netflix, Uber also make use of React in thor codes.

React is raw. It is a library built on Javascript, which can be used for making powerful frontend web applications and mobile applications. To be an expert in React, you should have smooth hands with Javascript as a prerequisite.

What’s up with Angular?

Angular — A Great Dad!

Angular is developed by Google, in the year 2010. It became popular around 2018. Google uses Angular in a variety of applications, including Google Cloud, Firebase, Express, etc. The main reason Angular is not very much popular among new developers is due to its complexity and being less beginner-friendly. Other companies like VMware, Upwork use Angular often.

Angular is a web framework built on TypeScript. For learning Angular, you should know Typescript beforehand along with Angular-specific concepts. Though Typescript helps to check bugs before the time, but it ain’t easier to understand. Also, Angular provides an opinionated structure.

Let’s understand React and Angular in a more detailed version by knowing their similarities & differences.

SIMILARITIES

It can be proclaimed that both React and Angular intend to solve front-end problems yet in far apart philosophies. They both effectively deliver all kinds of front-end applications ranging from mobile devices to big hulky screens. Even they extend themselves to build killer mobile applications with React Native or Angular for Mobile apps. Well, you may conflict to use these frameworks or Flutter, this leads to another debate for some other time. The best part is both of these use NPM i.e. Node Package Manager, this helps to share repetitive code snippets.

Above all, both of them use Javascript in one other way. React is a library built on Javascript while Angular is a framework built on Typescript, which is, in turn, a superset of Javascript. Thus, you can use Javascript in its purest form in React, while partially in Angular.

Many are confused with the term Open-source, this is pure because they haven’t contributed to it yet. Open-source is code that is designed to be publicly accessible and used by anyone anywhere on the internet. For example, back in 2011 Bootstrap had been released as an open-source by the Twitter developer, Mark Otto. The whole code is exclusively available to be used by developers to avoid building from scratch and save one of the precious resources i.e. time. That’s the power of open-source. But why are we talking about open source at this particular moment? This is because both React and Angular are open-source. Boom…!!

Both Angular and React possess a huge fan base and thus own an incredibly large community of developers. The documentation available for both of them is quite professional and easy to grasp. In case, you face any problem or got stuck while developing the code in React or Angular, don’t worry StackOverflow has your back and will save you in times of crisis.

Talking about their architectures, both use component-based architecture for implementation. The advantage of components is they can be used and reused within other components. The same components can even be used in different projects. Even, they both manage states, though in different ways the approach is similar. React uses Redux to handle states, while Angular uses Redux in cases of much larger applications. React and Angular both shake hands in using third-party libraries. These third-party libraries can be used in a variety of functionalities, which may include sending post requests to the backend, bringing the UI elements, including some pre-built api routes, etc.

You may wonder if React and Angular share so many points and how they’re different from one another. Well, of course, they do have plenty of differences. Thus, this generates a need to jump to the next section of this article.

DIFFERENCES

“Strength lies in differences, not in similarities” — Stephen Covey.

I don’t know, you may have heard this quote before or not, yet it is one of the most popular quotes used in the programming world. Almost every developer eagerly searches for the differences among frameworks, libraries, and new tech stacks emerging in the market. It is this ravenous of change i.e. need for differences, which helps us to emerge from better to the best and from best to brilliance in sense of technologies. That is the reason, we programmers, even know the amount of time taken by any program for its execution. Well, I’m going off track. It shouldn’t be discussed here as we are pitching over the dissimilarities of the two. Let’s have a glance.

1. Framework or Library

From the definitions of React and Angular, we came to know that, React is a Javascript Library while Angular is a full framework built on Typescript. So, what is the difference between library and framework by the way? To answer it subtly, the library is a subset of the framework.

Thanks to Tomas Petricek

Try to understand this with an analogy. Think it in a way, you’re reading a book, named as the solutions to your every problem, which consists of various chapters. Each chapter contains a solution to one particular problem in general. Hence, React is the chapter and Angular is the whole book. I guess you must have got the point. Commonly, frameworks contain libraries, but vice versa is not true. React is easy to learn and does a lot of work easily, but the truth is it uses third-party libraries for all its work, while Angular has its code built in to support all such tasks. The tasks may include, API connections, posts requests, routing, state management, etc.

2. MVC Architecture

Thanks to freeCodeCamp

As a developer, you’re pretty well known to the MVC architecture stands for Model, View & Controller. React surpasses only the View part while Angular comprises of whole MVC architecture.

3. Reusability in terms of DOM

React wins Angular in terms of DOM manipulation. While rendering components and other stuff on the frontend, React creates a Virtual DOM and compares it with the original DOM. whenever & wherever it finds changes it alters that part of the DOM. This, in turn, increases performance and minimizes time issues. In the case of Angular, every time a web application is re-rendered, it creates a new document object model and uses it from scratch. This leads to compromise with performance as expected.

4. Scalability

It is a general measure to analyze a web app’s ability. When there is a huge amount of load how your application is going to respond, will it crash or lag, or can handle the responses by delivering the best performance on-increment or decrementing the traffic. As, Angular is a framework and has complex architecture compared to react, undoubtedly it wins the race in terms of scalability.

5. Development in Mobile Applications

In React for developing mobile applications, you can use React Native, while with Angular you need to go with NativeScript. Although, they both offer comparatively a variety of features to be implemented and carried out, yet React is more powerful in terms of mobile app development. Even, the other frameworks like Flutter are compared with React Native. React is powerful due to one more reason that is the same code that you’ve written for the frontend part of your web application can be altered and used with React Native. With React Native, a team can even maintain two platforms by sharing a common technology.

Aren’t these similarities and differences enough to reach a conclusion where you can choose one among them? If not, it is the right time for the next section to pop up.

WHICH IS BETTER?

Let me tell you one simple thing. Which is better’s answer varies from person to person. If you’re more serious about frameworks, you do not want to use third-party libraries, and are concerned with in-build codes, probably Angular is better. But if your main concern is to quickly learn new tech stacks and start building beautiful frontend web applications, then React surpasses Angular.

The answer ultimately depends not only on one particular factor instead on a wide range of criteria, thus both are brilliant in their respective domain.

SUM UP: Which one should you choose?

To be straightforward, if you’re a beginner, then I would recommend not to waste much time on comparing the two instead start exploring ’em as soon as possible. Though both can be considered to be a cakewalk for a learner but to start with, I would recommend React as it provides syntax, components, props, hooks, etc. which are easy to understand for a freshman.

So avoid thinking, start exploring now. With this, we came to an end of this article, I hope you got cleared with your confusion. Thanks for being a good reader.

Ps. Many of my readers ask me why you do so many images/gifs in your articles. That’s simply to engage lovely readers like you till the end. Just like this last meme via @justin

HAHA! This was super funny.

--

--

Shashwat Agrawal
tech@iiit-gwalior

Passionate to Write | Love to Paint | Settled on Strings | Budding Engineer