reactjs-vs-angularjs

ReactJS vs AngularJS (Library vs Framework)

JavaScript frameworks are developing at an extremely fast pace. This post is describing main points, advantages and disadvantages of ReactJS and AngularJS as Library and Framework.

React-vs-Angular number of open positions worldwide
React-vs-Angular number of open positions worldwide

ReactJS

 

  1. Just a small view javascript library
  2. Components: emerging web components standard/Component based architecture
  3. Size: smaller than Angular, so a bit faster
  4. Has a Virtual DOM, which renders updates faster than Angular’s Regular DOM
  5. Uses JSX, which combines markup and logic in the same file (making components easier to read)
  6. Data Binding: one-way
  7. You Can use ES6/7 JavaScript, although you can use Typescript or Flow if you so choose
  8. Mobile: React Native is faster than Angular’s solutions
  9. Testing: Jest & Enzyme
  10. Learning Curve is lower, but you only get the view. Because of this, you’re going to have to learn a slew of 3rd party libraries. Ex. State management (Redux or MobX), Asynchronous calls (react-promise, react-thunk, or react-saga), etc.
  11. Scalability: is more testable, so also easy to scale
  12. Popularity: has increased exponentially
  13. Open source: GitHub stars: 111,927 / Contributors: 1,242 / Issues: 287
  14. Used on: Facebook, Airbnb, Uber, Netflix, Instagram, Whatsapp, Dropbox
  15. React Fiber will increase the speed of React dramatically

 

Cons of ReactJS:

  • In ReactJS you need more code for development then it’s counterparts.
  • Not using isomorphic approach to exploit applications leads to SEO indexing problems.
  • ReactJS has large size of dependencies.

 

 

 

 

AngularJS

  1. Is a full framework
  2. Has a Regular DOM, which renders updates slower than React’s Virtual DOM also has a virtual Dom too
  3. The rendered JavaScript and HTML maintains a physical separation
  4. Utilizes Components: emerging web components standard/Module + Component based architecture
  5. Data Binding: two-way
  6. You must use TypeScript
  7. Scalability: easy to scale
  8. Mobile: Ionic and Cordova are slower than React Native
  9. Testing:  Jasmine & Mocha
  10. Learning Curve is higher, but once you understand it you have an entire MVC framework
  11. Popularity: dropped since AngularJS (Angular 1)
  12. Open source: GitHub stars: 40,963 / Contributors: 732 / Issue: 2,162
  13. Size: larger, resulting in longer load times and performance on mobile
  14. Used on: Google, Nike, Forbes, Upwork, General Motors, HBO, Sony

Cons of AngularJS:

  • Basics are quite easy , but then learning curve becomes very steep making it hard to learn.
  • Scopes are easy to use, but hard to debug.
  • Directives are powerful, but difficult to use.
  • AngularJS has search engine indexibility.