At BeeReal we work with latest technologies in multiple kind of enterprise projects. A common question our customers usually ask is this one:
What do you recommend for our next enterprise web solution? Angular or React?
Both Angular (Google) — released in 2009 — and React (Facebook) — released in 2013 — are great solutions for modern software development. They have a big community around and are backed by great companies (Google and Facebook). So, the decision to use one over the other is not easy.
Big enterprise usually have millions of users and millions or billions of dollars that are impacted by the software they manage. They want to stick with a technology for a long time and require consistency, clear best practice, and minimal unknowns. Angular is better in this field with more years in the market.
Although Angular faced important issues when it evolved from v1 to v2 (incompatibility), it has since evolved in a more mature fashion, keeping quasi-compatibility between v2 and v5.
Most enterprise users are migrating to Angular 2/5, while startups are going with React.
How to quantify risk in large companies?
Large companies quantify risks in two different areas: support & community. When comparing React and Angular, you can get a better sense of why Angular benefits them:
- Support: React discontinues support quickly, and remaining updated is difficult. Google’s public goal is no more breaking changes after release 2.0 (see comment above re. compatible evolution).
- Community (availability for hiring): Due to openness of the technology developers of React, they’ve less standardization on the way to use the library. On the other side, Google is releasing best practices on how to write code using their framework. So, it becomes easier for long term web app maintenance.
Based on our experience, making web applications for enterprises, we can list a couple of reasons why we prefer Angular (starting with v2) over React:
1. Framework vs Library
- React is a library and has a View, but lacks Model and Controller components.
What does this mean? If you choose to start working with React — you need to include many 3rd party solutions (not developed by Facebook) to get a complete MVC application running. These solutions are created by the same community. Some of them are really great, but the major risk is that they could become obsolete (without maintenance), so that you are forced to replace them with another one. Probably this will change in the near future but this is the current state for the moment.
Both have a great community. You can find multiple open source extensions in many different subjects. What I’ve seen is that React’s community is young, so it’s possible you’ll have to do a lot of “reinventing of the wheel” in order to get the specific features you’re looking for.
Angular 2 was massive improvement compared to Angular 1. But React is faster because of the way it was designed.
React uses a virtual DOM: Instead of manipulating the DOM directly (which can be error prone), React stores two copies of a Virtual DOM, the original and an updated version that reflects changes fed in from the view. See ‘The Real Benefits of the Virtual DOM in React.js’, and ‘The difference between Virtual DOM and DOM’
4. Use of TypeScript
You can also use TypeScript in React but that’s not a common case.
In practice, Angular’s way is far better and easier to understand: with JSX, you keep your view (HTML) in the same file that’s your business logic. This approach can be very confusing.
Again… both are great solutions (and we can add Vue.js to the list). During last months I’ve been seeing a clear path in the use of Angular for enterprise applications and React for startups’ world.
But as usually happens in technology — this trend can change soon, so this post can get obsolete also ;-)
- Quora, Which is better, Angular 4 or React/Redux?, 2017
- Why we chose Angular 2 over React for our enterprise software development work, 12/2016
- LinkedIn, ‘Why we chose Angular 2 over React for our enterprise software development work’, 12/2016
- The Real Benefits of the Virtual DOM in React.js, 04/2016
- The difference between Virtual DOM and DOM, 10/2015