DEV Community

Discussion on: What to Look for in a React Developer? Here are a Few Questions to Ask Them

Collapse
 
dmauldin profile image
Dave Mauldin

Some issues with the Angular vs React section. Since Angular and AngularJS seem to be used interchangeably, I'll just give the benefit of doubt here that the poster has never been an Angular (2+) dev.

  • Angular and AngularJS are used seemingly interchangeably here. This is absolutely not true and IMHO is a large part of the reason why Angular is not more popular. AngularJS is the very old 1.0 project and completely different than anything Angular 2.0+.
  • Architecture: Angular does most of it's work in the ShadowDOM, which for Angular's use case, you can think of as having a VirtualDOM for each component or component tree, that is attached to the DOM. Angular does change detection and updating of components with much better performance than updating the DOM, directly. This has the added benefit of encapsulation of components, ex: keeping styles from affecting elements outside of the ShadowDOM they're set on. ShadowDOM is also a web standard that is implemented by all modern browsers (and of course has polyfills). While it has similarities, it is still functionally different from React's VirtualDOM and thus the performance can vary, but again, much faster than direct DOM change detection or manipulation, while providing additional features.
  • Data Binding: Technically, both provide 2-way data binding. React recommends to not do it. Angular does not recommend against it, but it's rarely used in larger applications. I think the real difference here is that React recommends a use pattern for components where Angular lets you decide. In Angular, you can easily work in the same way as React, like passing in the state to be updated or better yet, a function to be used by the child component.
  • JavaScript Library: This statement is actually hard to read, but I think it's intending to say that you can include React from a CDN, whereas Angular is always compiled into the app. While you can include React from a CDN and this can be useful if you're just adding a couple of components to an existing app, it's a very uncommon use case. If you are going to build a larger app, using React from a CDN is not a win. Are you going to do that for all of your libraries? For Angular, since it's a framework and not just a library, this would be something like adding React, ReactRouter, Axios, RxJS, etc. etc. all from CDN. Chances are, you'd get a much smaller total download (and memory footprint) by tree-shaking and bundling, which Angular is setup for, by default. And, AFAIK, is what React devs do by default, as well. I'll give you the point that, if you're just creating some components for an existing site, Angular is not for you. ;)
Collapse
 
praveen__pkm profile image
Praveen Mishra

Great insights, Dave!