Angular 2 vs ReactJS
Last post I promised you a look at the default package.json file that is created by the Angular CLI but I thought I would pivot and share some events that have happened to me recently.
As you may know, I have been looking for a new gig. One of the questions that I have gotten consistently is "What is the difference between Angular 2 and ReactJS?" I usually answer one was created by Google and one was created by Facebook. We all have a good laugh and then they say "Seriously, what is the difference?" So let's go over how I answer this.
First, let me give a couple of disclosures here. First; I don't claim to be an expert in either system and second; I have written about 5 times more Angular 1/Angular 2 code than I have React, so my natural leanings are toward Angular. I will try to keep this fair and biased though.
Similarities
First let's look how Angular and React are similar. First they are both a subset of JavaScript, which should strike fear in the hearts of full stack developers. But fear not, a cool feature is both make JavaScript more object oriented.Another similarity, neither is supported by modern browsers both have to be transpiled (yep, that's a real word) into JavaScript to have browser usable files.
Both are optimized for use in Single Page Applications (SPAs). Which sounds relaxing but they really aren't.
One more similarity is they both need Node.js and Node Package Manager to to set up and install packages, so there is a slight learning curve there.
Ok, that is all well and good but I still haven't answered the original question, lets do that now.
Differences
I will go over what I think are minor differences then hit the items that I think are key differences.Angular is a framework where React is more of a UI component renderer. What does that mean? That means that you have to install other components like Babel to transpile your code to javascript and Redux for extended state management. So there is a a little more learning curve with React.
React has been around longer than Angular so it has a much larger, active community. Angular's community is growing but it is no where close to Reacts. Ok, what does this mean? If you are stuck there are more folks using React that you can help you out.
Angular has the Angular CLI (which I wrote a spiffy little blog post about HERE ) to set up a project. Three Node commands and you have a base application. React needs the Facebook starter project and then some bundling components to get up and running. Now if you had to do an Angular app from scratch without the CLI, React's set up would kill Angular but the CLI is a difference maker.
So, those are some minor differences but I don't think any of these would change the way you think about either system but let's look at one that might; data binding.
Angular uses observables or watchers for two way data binding which can be pretty cool. You get an update from an input in the UI and it instantly updates the model and vice versa. React uses one way binding so data binding has to be managed.
So clear victory for Angular, right? Not so fast. Imagine if you had a large data heavy application, the overhead of all those observables passing data back and forth will bog your application down.
Angular 2 has some features like the Ahead Of Time compiler and lazy loading to help optimize some of the overhead but React is still has a lot less overhead on large applications.
So which is better? Depends on what kind of app you are writing and your comfort level. I recommend that you try both and see which you like.
On my next post we will look at how Chris Hardwick went from MTV game show host to king of the geeks. Just kidding, we will go back to looking at the Angular CLI default files.
One last thing, the Rocky and Drago images that I used in the open are owned by MGM/UA.
Catch you later,
Allen
Good comparison. Angular and ReactJS both are good for web development. both has importance based on priorities.
ReplyDeleteBest Regards,
ReactJS Training Institute in Hyderabad
Helpful post, I have learned the difference between angularjs vs reactjs. Keep up the good work and share more like this.
ReplyDeleteReact js Training in Chennai | React js Training
Thank you for uploading such a wonderful content on recent technology.
ReplyDeleteHadoop Training in Chennai
Big data training in chennai
big data training in velachery
JAVA Training in Chennai
Python Training in Chennai
SEO Training in Chennai
Hadoop training in chennai
Big data training in chennai
big data training in velachery
Thanks for this article.You can visit my website :temp mail apk
ReplyDeleteWhat a great platform that for such nice information Have a Look keep up the good work thanks!visit here:alien shooter apk
ReplyDeleteHi This is SRK i'm suggesting you this is app Bully Mod Apk
ReplyDeleteTry this new app BeeTV Apk : which is most trending now.
ReplyDelete