1,007 total views, 1 views today
(I am ignoring other frameworks as of now).
The dilemma most architect face when selecting between React and Angular for their front end development.
I have been in various real discussion of this sort as a consulting architect and my choices are very simple depending on the below parameters.
Hope some of you may find this useful. (Just a note, I like both frameworks, though some may call React as library, that’s fine, I am using it here interchangeably.).
For some strange reason I have observed the learning curve for React is a bit higher than Angular (even though React is quite tiny in feature compared to Angular).
But once the devs are familiar with React, then there is no going back.
And well here is the reason for the same.
- You should be familiar with some common patterns
- Developer should not be afraid of Higher order components (which is again fundamental concepts)
- State management practices.
Angular on the other hand being a framework has certain way to do things (which is good) as the onboarding becomes quick.
- For customizing user interface behaviors when third party library/packages are not sufficient.
- For fixing any immediate user interface issues, in case the team is using third party libraries (as the project deliverable cannot wait till the library developers add features or fix issues).
- For creating or customizing components that meets’ the performance standards. So, many people uses libraries and packages here, but at many times these libraries and packages are required to be modified to meet your goals.
- To understand memory leaks and how to avoid them as behind libraries and frameworks, lies developer code as well.
- For creating reusable components (UI elements) for enterprise.
Having sorted that, actually it won’t matter now, what you chose because the team will be able to deliver effectively.
But still consider the below questions.
Important Questions to ask
– Are you developing a product, which will become your primary source of income and you plan to maintain/change over a long period of time.
– Are you developing a website, which is hosted as a SAAS and is a revenue generation mechanism for your company and the company’s existence depend on it.
If the above is true, ask yourself the question. How much would you like to get tied to a library or a framework so much that any impact on the library creators decision may impact your business.
So, always in this case chose the library or framework with least resistance but still allow multiple choices over the course of its growth with minimum impact.
If you do a quick research as to what kind of products are being developed using React and Angular, you will quickly find that React is dominating the SASS, and other large products/websites.
That itself should give you enough confidence to start the journey. But always, use your own good judegement.
Why I will chose React?
Why? Because of the following reason.
- React is lightweight (has preact an alternate lighter high performance project as well).
- React does one thing and it does it very effectively.
- If need be, many other parts of the system can be easily replaced. (I can replace the entire VDOM itself).
React – The biggest benefit – Thinking in Component
The biggest benefit of React is that from early on devs are forced to think in terms of component (This can be done in Angular as well), but React makes it very clear.
You can very easily create simple, to medium, to compound components very easily in React.
But Is React good for kinds all Project/Products?
If it’s a typical CRUD app, then developing in Angular could be faster (again depending on the skillset of the people) as Angular has everything baked in.
But if you want to move beyond typical CRUD and need freedom, then React may be the choice.
Do I use React for all my projects?
Let me be very honest here. All internal projects that we do is in React. Some we do in Angular and other library to be in sync with the real world as we do lot of consulting and research activities because we want to be absolutely sure when we recommend any library or framework. So, we would like to know all prevailing details.
When we are hired for client work, our first priority is get the client expectation from the project, their team’s current skillsets etc. Based on that we list out the pros and cons and give them the overall picture.
And if they chose, Angular, we provide full support for it. (But so far it hasn’t happened in my 7+ years of active consulting since we started Algorisys).
Exceptions are when the client is already using Angular (and it’s mostly internal projects), we stick with the same, as the decision was already made in the past.
Does that mean Angular is not used anywhere?
No. Many team uses Angular. Some of our clients use angular, but mostly they are internal projects.
Angular is a nice framework.
I have seen some websites (don’t recollect, built on Angular). And there could be many more on it.
Before React, I was a huge user of Angular (including angular.js, ember etc).
NOTE : These are just my thoughts based on working on various large full stack projects at Algorisys as well as in my consulting engagements with with clients with massive apps at scale.
But if we encounter an Angular app we work with same equal passion as well.
Hope I tried to present my case, based on my heavy core experience on web applications at scale
A side note (Ionic is smart)
One big reason, I still stuck with Angular was because of the ionic framework for mobile development.
For a good frontend dev Angular and React are both same
So, readers are free to share the links of live production website at scale built on both React and Angular and let’s take a stock together as well.
May be I will encourage some of readers to write a blog on the same topic but why Angular should be the choice.
Tech communities and Industries need healthy debates and comparison rather than one sided opinions.