When choose {React or Angular 2}

Narek Mamikonyan
3 min readNov 20, 2016

--

At the moment when I was writing this post on internet you can find a lots of articles about Angular 2 vs ReactJS , some of them blaming Angular 2 some React JS and others trying to be honest. I’ve read a lot about this topic and worked with both technologies and this article like recap of research.

Also there is one belief that one is a library one is a framework and you can’t compare them , I’m going to make you sad because it’s hard but there is a point’s that they have similarities which you can compare and connecting some third party libraries with React you can have almost the same ecosystem which in Angular , but also lets do not forget most important point that both libraries help you to make rich component based on UI’s. And as said Cory House in his article about Angular 2 versus React

Choosing between Angular and React is like choosing between buying an off-the-shelf computer and building your own with off-the-shelf parts.

Let me be honest. I’ve tried to write down cases when I’m choosing (or will choose) Angular 2 and cases when I’m with React JS.

Similarities

  • Both are technologies, which allows us to define the component-based UI of our applications (mobile/web/desktop).
  • Both work great with FRP & OOP paradigms , state management (Redux like) and with design pattern’s MV*
  • When it comes to server-side rendering React offers a much more mature handling, but Angular 2 stays ahead in performance (in some cases).
  • Both supports native app building , React Native , Angular 2 + NativeScript

Difference’s

  • React is more library rather than a complete framework (extra libraries needed from the community)
  • Angular 2 provides full set of functionality supported by the core team at Google
  • Enforced separation of concerns in Angular (pipes, services, DI)
  • Different change detection mechanism (Virtual DOM — React, ZoneJS — Angular 2)
  • Different way to declare your UI (Reacts puts HTML->JS with JSX , Angular 2 puts JS->HTML with ngFor, ngIf …etc )
  • Angular 2 is developed in TypeScript
  • React in ES5 + ES6

Why choose React

  • If you want freedom and assemble libraries yourself
  • If you just need to render data
  • You can incrementally migrate to react from legacy jQuery-ish app
  • If you have real-time data and you have to re-render UI frequently or another type of business need which can cause performance issues
  • If you have limited time for learning
  • If you preferred functional programming
  • If you want to write pure JavaScript (ES6|ES5)
  • If you don’t care putting JS in HTML

Why choose Angular 2

  • Since AngularJS is a framework it provides functionality that are out of the box
  • AngularJS helps you get started more quickly without feeling intimidated by decisions
  • This also helps new developers feel at home more quickly
  • Once mastered it is easy to use
  • Custom change detection strategy
  • Separated and reusable html templates
  • If TypeScript your best friend
  • If you familiar with OOP concepts
  • Dependency Injection , form validation , pipe’s etc….
  • 2-way data binding

And at the end I wanted to mention when sometimes we are coming back to question to choice between library and framework.

Of-course I didn’t covered all points , you are welcome to add your points.

--

--