Why You Should Choose React Over Angular 2 or 1 For That Matter
I remember coding with Angular 1 back in 2013 or thereabouts. Using Angular 1 directives was pretty remarkable at the time. Angular had bold promises about enhancing HTML with custom elements and a whole lot more.
Then you had to deal with transclusion, dependency injection, factory services and a whole bunch of other mumbo-jumbo.
In a little corner far away the Ember kids were grokking that. And when they came out to see us, the smoke from all the Angular directives and transclusions was enough to drive them back away into their little cave once again.
They were right, of course, duh! It was just that, in that Brave New World, it was easy to mistake factories and snake-oil for productivity. And StackOverflow had not even made it to the promised land! They were still using jQuery, ha! (And doing it very productively, I and a million programmers must add!)
If you were really brave, you could always go nuclear and use Backbone, but among its few faults, hype was never one Backbone weakness. Everybody more or less quickly clambered the Ember train or this shiny new Angular “bullet” train and failed to see the value of simplicity that was core to Backbone.
Let’s Start From Scratch
Then React came along and was bold enough to actually throw out all that gunk. Few of us thought so, of course, at first. The Angular love was just too fresh, the dream of the promised land too vividly etched in our programmatic minds, the high priests of Dependency Injection too ensconced in their Olympian perch in Mountain View that few even noticed the tremendous change that had occurred overnight.
A bunch of crazy upstarts had dared to challenge the Emperor in his own backyard. And when you looked at it carefully, they had won!
React still came with some conceptual overhead, and some rather inelegant semantics. Wrapping your head around JSX was like trying to switch from a QWERTY keyboard to using the OODAA keyboard, like, “what exactly did you say we now need to do with our HTML”?
Still, after the disillusionment of those crazy Angular days, anything had to be better. And it was fast! Shadow DOM! Functional, stateless components! And Atom could understand it!
Then along came React Native, and for me that was really the game-changer. Mobile, the only thing keeping me in Angular, was gone. React Native was even better than anything that could challenge it. It still had bugs and had not even reached release, but in time it would just be better than any non-native solution. Angular was dead! Game over.
The Matrix Reloaded
The Return of Angular
So fast-forward and the Angular chefs went back into the kitchen, and swiped some good ideas from React, Ember, Backbone and everyone else, as best as one can see, and went at it again.
And I kinda liked it. The components are nice, the directives, where you use them, seem to have been simplified, no more controllers and crazy patterns, unless you happen to live for that stuff. It actually runs faster. Uses ideas from the shadow DOM and dared to rethink its own idioms. I give em a lot of credit for that.
The Angular 2 experience and productivity is much nicer than before, I have to say. However, I wish they had not made everyone learn TypeScript.
So, this whole Angular 2 craze? I just don’t see it folks. I’m here to anoint the new king, and React.js it is!
React has spawned off really good side-effects like Riot.js, which in turn inspired Vue.js, and then you have MobX, Redux and a bunch of reactive libraries that have all kinda emerged out of this innovation.