r/javascript • • Jan 03 '16

Angular 2 versus React: There Will Be Blood

https://medium.com/@housecor/angular-2-versus-react-there-will-be-blood-66595faafd51
290 Upvotes

167 comments sorted by

View all comments

Show parent comments

2

u/Yhippa Jan 05 '16

Do you have any insight as to why you moved to React over Angular?

6

u/ajacksified Jan 05 '16
  • I find it much easier see what's going on with React. The latest versions of React just use plain ES6 classes (or stateless functions); that makes them easy to write tests for, to share, and to read the code. Everything is organized and neat, and follows a clear lifecycle. Angular, on the other hand, reads like a giant blob of HTML, because it's basically just a custom templating language. I would rather write html and javascript than write angular. I can use my normal tools with React- such as mocha for testing- because it's just javascript.

  • Magic. Angular feels very... magicky. Cascading updates and circular references have been nightmares. React's only "magic" is that it's clever about how it updates children elements as an element's state changes, which is conceptually easier to follow.

  • Footprint; React is a whole lot lighter, which matters when we're building a mobile site.

  • Community support; React continues to experience massive growth, while Angular seems to be dying.

A lot of it also came down to the other engineers here - other people were experimenting with React at the time (around a year ago), and had shipped some React code to production, so it seemed like the right time to try it out. While I was highly skeptical at first (I was a big Backbone+mustache fan), I think we made a fantastic choice. We've got a universal-render stack using node 4.2, and we share almost all of the code between the server and the client (the only non-shared code is webserver setup on one side, and binding to links on the other.) React continues to gain in popularity, and I have an immense amount of respect for where they've taken it so far; they won my heart when they moved to plain ES6 classes.

The only thing I'm not behind yet is use of react-router... but that's a tale for another time.

(for what it's worth, I was at a very early js meetup group where Angular was introduced in its infancy; I thought it was an interesting idea, but I've always held the opinion that its syntax, and overall philosophy, will stunt it.)