Angular and React are like two heavyweight fighters duking it out for capturing the web development world. They are two important pillars of the modern javascript landscape. Both are primarily used to build single page applications. There are countless Angular versus React articles out there. However, most of them try to pit them against each other and try to show one of them winning based on their personal preference.

But is that even necessary?

Is there even a Angular versus React thing going on in the industry?

Personally, I don’t think so.

In this post, I won’t be going the winner or looser way in this article. What I believe is that there shouldn’t be a comparison at all. At least, not in the exact sense of trying to prove one framework better than the other. What I will be doing is contrasting the approaches used by both of these excellent frameworks and try to understand where they work well.

Framework versus Library

Even though I used the term framework till this point, there is a fundamental difference between Angular and React.

Angular is a full blown framework with all the tools, features, and best practices bundled in one massive package. On the other hand, the core of React is just a small library that helps you make web applications.

The fundamental difference between these approaches is that typically in a framework, it is the framework that calls your code whereas in the case of a library, it is the application that you write that calls upon the functions available in a library to fulfill some specific need. Frameworks are generally more opinionated in the way things should be done whereas a library provides much more freedom.

Depending on the way you look at it, this could be a good thing or a bad thing. In my opinion, Angular is better if you need more control over the standards and the development approach. This could be quite important for enterprises that want more control over the code-base and the standards used across teams.

On the other hand, React is much more open-ended. Usually, React is augmented by various other packages that may or may not be developed by the core team to turn it into a framework of sorts. For example, if you wish to enable routing in a React app, you need to add React-Router. If you want code splitting, you add React-Loadable. However, controlling these packages and their versions might be a challenge across a big development team.

Typescript versus Javascript

One of the major deal-breakers or deal-makers is the underlying language Angular and React use.

Angular uses Typescript, a super-set of javascript. React uses plain-old javascript bolstered by ES6 support. As the name suggests, Typescript is strongly typed, follows a bunch of object oriented principles, and could generally put off web developers used to javascript.

However, Typescript isn’t necessarily a bad thing. Being strongly typed means that you get less errors just because someone messed around with incorrect data types assigned to a variable. It also helps you implement better design principles. This doesn’t mean that you can’t apply good design principles with React.

Since React uses plain javascript, it also gels well with thousands of javascript libraries that makes developement easier. The same can’t be said about Angular.

In my view, if you have a cross-capability team where you have a bunch of Java backend developers and you want to utilize them for front-end development, they’ll feel right at home with Typescript concepts. If you have far more javascript developers, then React will be faster to understand.

Learning Curve

The learning curve for Angular is famously long. There’s no doubt about that.

To do effective development using Angular, you’ve to learn a bunch of stuff. Typescript, MVC Pattern, the hundreds of pre-built methods that are part of the core Angular framework. Some of the common things are Components, Directives, Angular Router, Data Binding, Pipes, Observables, HTTP Client, and many more.

React also has something called JSX, a type of pre-processor for HTML. Basically you don’t write HTML in React but you write JSX. It has some quirks such as using className instead of class in CSS. But such things are pretty less and relatively easy to wrap your head around.

If learning curve is a big issue for your development team and you don’t want the overhead of learning a bunch of stuff, React is your best choice. Angular requires a sizable amount of investment in building competency.

Scalability

Angular, being a framework, is very good at scaling as the application grows bigger. It’s component driven architecture backed by strong typing leads to highly robust code even as the code-base gets bigger. Angular also ships with a very powerful Command Line Interface (CLI) that makes it easier to build components by taking away most of the boiler-plate code.

React also has something called Create-React-App to scaffold apps but it doesn’t come anywhere close to the Angular CLI in terms of sophistication. Also, React applications can become hard to maintain as they grow and most of the time, you’ll then have to add something like Redux into the mix to manage your application state properly.

Basically, the choice here boils down to what you are planning to build.

Industry Support

React is growing at a tremendous pace. Even if you remove Facebook from the mix, React has been utilized by big names like Instagram, Whatsapp. Because React uses javascript, there is a lot more community support and tools available for use with a React application.

Angular is run and maintained by Google and one cannot simply ignore Google. Despite the problematic version change from AngularJS to Angular 2, Google kept on improving the framework. With Angular 4, 5 & 6, it has become more and more stable and consistent in its vision.

Point is that you can’t go wrong with Angular as well as React. Both are exceptionally good and are here to stay. The important point, though, is that you make the right choice for the given need.

Now, here’s a quick of rundown of what you can potentially choose out of the two in particular frameworks.

If you are an Object Oriented Developer wanting to do web developement: Go For Angular

In case you work at Google: Angular

If you work at Facebook: React

If you thrive on flexibility and community support: Go for React

In case you are building mammoth enterprise applications: No doubt, Angular

If you have a big development team and you want common standards: Angular

If you don’t want to learn for a long time before starting up: React

In case want proper HTML files for prototyping and designers: Angular

However, most important thing is that don’t ignore something just because of the hype. At the end of the day, all of the frameworks are simply tools. You basically should understand how to pick the right tool for the right job.


Saurabh Dashora

Saurabh is a Software Architect with over 12 years of experience. He has worked on large-scale distributed systems across various domains and organizations. He is also a passionate Technical Writer and loves sharing knowledge in the community.

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *