React makes me resent AngularJS

Just went through the React official tutorial and I am amazed by the simplicity of the framework as opposed to the unassumed complexity of AngularJS. I played mentally with it for 5 minutes and it just feels like a box of Legos™ where each block has its own obvious shape and role and can be used independently of the others. At first sight, working with React looks like a simple game of fitting blocks inside each others, allowing you to build anything from the simplest of structure to the most intricate work of art.

To be fair, I haven’t even written one line of code yet with React, yet it feels natural and straightforward. I remember going through Angular tutorials amazed by how it seemed to just magically work but unable to fully grasp the bigger picture. Every component of the framework felt it had roots growing all the way to some obscure foundation which would require weeks to understand and master. I felt overwhelmed by the amount of conventions and setup to go through before being able to build a simple app.

Here’s some of the frustration I went through:

(function() {
    var MyController = function($scope, greeter) {
        // ...
    }
    MyController.$inject = ['$scope', 'greeter'];
    someModule.controller('MyController', MyController);
})();

All in all, to develop in AngularJS it seems you have to go through a full month of head-banging on the table before you can manage to have something running by something else than just pure magic. I understand that AngularJS was built at a time where alternatives did not exist and it had to fight against browsers to run properly before ES5 support. It is pretty impressive in itself and can definitely be used to build rich and complex web applications.

But encountering React has made me feel like I’ve been abused of by AngularJS. Why all the pain ? Why the throbbing headaches ? I get that React does not have the same approach and is built as a library rather than a framework. This makes learning React more of a step-by-step experience, which makes it much easier to grasp. Nevertheless, shouldn’t it be the way to go for frameworks too ? Shouldn’t frameworks be essentially composed of loosely-coupled modules or libraries rather than one big monolithic, multi-layer block ? There’s a reason why we love Legos™, that’s because it makes building stuff a lot more easy and enjoyable. Not blaming AngularJS though, it does (did ?) serve a purpose, but wow, how I enjoy the breeze that React blows my way!

PS: I know that Angular 2 has addressed most of the downfalls of AngularJS, but it’s apparently still one big monolith. Not sure I’m ready to embark on another hell-bent journey to learn it from scratch again…