How to compare _anything_ to Angular and AngularJS
“… vs …” are the most readable articles. Especially when they evaluate today’s favourites — Angular, React and Vue. While a considerable part of them is too loyal to one of the subjects, the small part of articles is usually balanced enough and provide a valuable and precise comparison. And it’s sad to see obvious gaps in such articles.
“Angular 2 vs React. What to chose in 2017” is fresh and one of the most balanced comparisons of React library and Angular framework (Tiziana, thanks for pointing to it). However, not all Angular-related information is 100% correct there. This article is not to blame, but just to correct some facts there.
So, Angular or AngularJS?
The very first and most major point. AngularJS isn’t the same as Angular. Let me repeat it. AngularJS and Angular are different frameworks.
- AngularJS is for the first version (1.x)
- Angular is for versions 2+ (in reality — it’s really new framework).
The wider explanation can be found in the Branding guidelines post on the Angular blog.
So, using both terms as synonyms isn’t precise. Let me first show the difference.
Based on comments under the original article and some investigations I’ve stayed with the following query (link):
I’ve tried a number of requests for both technologies and left only major ones. Would appreciate if you can suggest something instead Reactjs to improve stats for React. Also, I used 5 years and filtered by Computers & Electronics category. Btw, filtering by Internet & Telecom category shows the same but looks more offensive :)
- AngularJS is the only term that is clearly going down
- React, Angular and Angular 2 show a stable growth
The second point is very interesting. It shows that there are no massive “Angular -> React” or “React -> Angular” migrations. Both technologies just continuously fill their markets. And it seems — both are winners :)
Let’s do the same (link):
This looks quite unexpected. Starting early December percentage of React jobs is growing. However, it’s about jobs posted. What about jobseeker interests?
Looks like during a number of incompatible API changes the overall interest went down but resurrected immediately after the API was stabilised. Again, no massive migrations detected.
The basic information
This is the original table.
However, it’s not quite correct. Again, let’s separate AngularJS and Angular:
- Versions are chosen for Feb 23rd, the original article publication date. Current Angular version is 4.0.1
- Angular was released in 2016. Up to RC5 released in summer 2016, there were a lot of incompatible API changes and it wasn’t supposed to be 100% ready for production. Comparatively, the very first AngularJS was offered for usage in 2009 (link).
- Also, stars and contributors values are lower for Angular.
Core features Angular vs React
Again, let me start from the original table with few visual marks (red !) and add few comments below.
- DOM. Angular can use DOM but its goal is to use “Shadow DOM” technology. While it’s not yet implemented in all browsers, it’s emulated via DOM.
- Fails When. Can be compile time as well if using correct architecture and interfaces.
- Binding. 2-way was a feature of AngularJS. In Angular, it can be used, but uni-directional is the standard way here.
- Templating. This point has really surprised me. While it’s possible, it’s highly recommended to have it in separate plain HTML files.
Few more points from Cons and Pros
- Angular can do deep object comparison. For sure, it’s not recommended.
- Angular cli doesn’t only manage the app but builds it as well. No need to support separate build system, manage settings, track dependencies like which version of the Webpack works well with which version of the Typescript compiler or the rollup.
- Regular DOM. Angular uses “Shadow DOM” approach which allows to fully isolate components from each other. While the technology is officially in draft status and not supported by all browsers yet, Angular emulates this approach with usual DOM. Even in this case, there’s no huge difference in DOM-related performance between React and Angular.
I can’t say better then it was said initially by Andrew Alexseyenko:
React and Angular both are great technologies that give miscellaneous opportunities in development.
Finally, there is no “silver bullet”, you need to choose the right solution that will suit your challenges, goals, and long-term strategy.