Edited Mar, 2015: Previously titled “Why I Do Not Recommend Learning AngularJS”. In retrospect, my arguments are superficial and likely apply to the specific situation I was in. In addition, I was wrong that learning a new tech is wasteful. Learning anything makes you better at learning and that is what we should all be trying to do. Learn what you’re excited about!
Despite it’s good qualities, I did not enjoy learning AngularJS. With all the available options of web frameworks (e.g. Ember, React, Backbone, etc.), Angular fell behind in the following three areas:
- Non-transference of Skills
A lot of people ask me what I think about AngularJS, so I wanted to take some time to collect my thoughts and try to explain it clearly and rationally. The following is the result.
I would like to start by saying AngularJS has a lot of good qualities, or else not so many people would use it so happily. It makes developers excited to do web development again and that is hugely important.
With that being said, I did not like learning AngularJS. With all the available options of web frameworks (e.g. React, Ember, Backbone, etc.), Angular falls behind in the following three areas:
- Non-transference of Skills
I normally do not like picking on performance flaws, especially when a conscious decision has been made to trade performance for productivity. I can understand that trade-off. I do Ruby on Rails 😉
However, Angular’s performance has such serious problems that it becomes almost unusable for certain features or whole applications. The threshold of how much work you can make Angular do on a page before performance tanks is scary low! Once you have a couple thousand watchers/bindings/directives doing work on a page, you notice the performance problems. And it is not actually that hard to get that large amount of binding happening on the page. Just have a long list or table with several components per row, each with healthy number of directives and scope bindings, and then add more elements as you scroll. Sound like a familiar feature?
Again I’d like to say that performance is not that terrible of a problem to have, because new versions of a framework can (and almost always will) optimize around common, performance problems. I do not think performance will be a long-term problem in Angular; but it is a problem right now.
Ember is also quite complex, but the framework itself gives direction for project organization which mitigates some complexity. Also Ember is better at mapping its concepts to commonly used paradigms which I will talk about in the next section.
With React, you can be productive after learning a few function calls (e.g. createClass() and renderComponent()), creating components with objects that implement a render() method, and setting your component state to trigger re-renders. Once you wrap your head around what React is doing, it is all very simple. My experience was after weeks with Ember and Angular, I still did not grok all the complexity or feel like a useful contributor to the project. After a day with React, I was writing production quality UI with ease.
Non-transference of Skills
Why didn’t my jQuery skills transfer? Because my development with jQuery taught me a Domain Specific Language (DSL). While DSL’s can improve productivity, knowledge of them will seldom transfer to other areas. The reverse can also be true. You could call this inbound and outbound transference.
If you know Angular and are productive with it, great! Use it. Enjoy it. Be productive with it. I tried Angular, and it just didn’t do it for me.
If you want the experience of a framework that does a lot for you, go for Ember. It will arguably do more for you than even Angular. As I have seen, the Ember team is also more responsible/devoted to supporting large-scale applications or corporate clients which require stability and longevity. They are the clients who do not want to be rewriting their apps every other year. The one drawback I have seen is that Ember prefers to control everything of your app and does not play nice with other technologies. If you have substantial legacy code, Ember will be a problem.
AngularJS will be releasing 2.0 soon, and it will be completely different from Angular 1.x. Controllers, Scopes, and Modules are all going away. To me, that seems like realization by the Angular Core Team that some of those neo-logisms did not work out.