Why Angular 2 (4, 5, 6) sucks

Such a clickbait title you say… But trust me, there are still a few valid points.

First of all, Angular team, I would to thank you for all these three years you’ve spent to make the new shiny Angular 2.0. But your new framework sucks. And I’ll tell you why.

I made a dozen of apps with Angular 1.x. Big ones like GoAbout website or real small ones like Sporteventa landing. I fell in love with Angular 1.x.

However, there is a very simple principle which I followed in all of my projects, even the biggest ones. The principle says:

Keep it simple, Stupid.

And that’s exactly where the new Angular has failed so many times.

Even though learning curve for Angular 1.x was not ideal, the framework itself was something more or less simple. It did not require TS, HTML compiler, CLIs, specific structure, webpack, Tree shaking, AOT compilation and so on. It just worked. I was able to insert just a bare `angular.min.js` in the file and start writing the code right away (even though I still used Gulp to livereload/build the app).

The whole idea of a good framework is that you start with the simple stuff and you make it more complicated only when and where you want it to be more complicated. While Angular team went in a completely opposite way.

Let’s go in details where Angular 2 is over complicated:

  1. It is written in Typescript

Don’t get me wrong, Typescript adds cool features to Javascript such as (obviously) types and not only. But do I actually need it? I’m not writing a software for NASA, I’m writing webapps. And I would like to be the one who decides what language I use. Not you. If I want to use TS, I will use it. But what If I just make a very simple prototype app where I don’t need TS?

Javascript became so popular because it was simple to learn, but with Types/Interfaces/Decorators, you make it complex again. Now I need to learn more, to have an IDE for checking errors and a compiler to make it javascript again. You made a Java out of Javascript.

P. S. I know that I can still kinda use JS with it. But in reality it becomes impossible because then I have to deal with the fact that everything else around Angular is made with TS (like plugins or docs).

2. Angular-made HTML is not a valid HTML anymore

Just think about the next sentence. Angular 2 team had to write a compiler to compile “Angular HTML” into HTML. Because some of the tags angular uses are not valid HTML.

No, that compiler does not make HTML more readable like Jade (aka Pug) does. The only purpose of that compiler to change angular tags into something more valid and (also) add a bunch of garbage into your final HTML.

But not only. The compiler gives an insanely useless traceroutes so whenever you have a error in HTML, well, good luck finding it. The whole app won’t start until you find it.

Also! Now you cannot use Jade (Pug) within your new project because, as I mentioned before, the html you write for angular is not valid and hence Pug (Jade) has issues compiling it (github issue).

3. Angular takes an infinity to hot-reload your code

The thing I love the most about JS apps is that I can change a piece of code and see the results immediately in my browser.

Well, with Angular 2.0 it is not true. Not anymore. I have a very powerful quad-core laptop and it still takes me 3–5 seconds to re-compile an empty angular app. For already developed apps like ng2-admin it takes ~10–12 seconds. You gotta be kidding me right?

Using old good Angular 1.0 and a simple Gulp setup I was able to concat all my code and reload the page in half a second.

The webpack configuration of Angular 2.0 is 300 lines long. It is so big and unreadable so they had to make a separate config for a config. Nice, right?

4. Huge size of the initial app

This is something everyone is moaning around for a long time. Bare Angular 2.0 (+RxJS) weights around a megabyte. Yes, a megabyte. It is like 6 times more than previous angular. And 10 more that I expect my users to download over a 3G connection.

I know that Angular 4.0 will be smaller, I know that you can use Tree Shaking and ahead-of-time compilation to make it smaller up to 3–5 times.

But still. Think about it. The initial angular code is so big and complicated so they had to make it even more complicated to make the code smaller. In other words, React or just old Angular are small enough from the beginning so they don’t even have to deal with all these optimization techniques.

I can continue the list but I think I’ve made enough points.

Conclusion

Angular 2 is not that bad. It is completely modular, follows specific structure, uses types and (in theory) allows you to write code with less errors.

But in my opinion, things should stay simple from the beginning. While Angular is not. It seems just over complicated.

I make web applications, not software for spaceships. Angular team has introduced so much added (and unnecessary) complexity, which means:

  1. There are more failure points. With not so helpful traceroutes, it becomes a headache which then converts into a huge timewasting
  2. It is hard to adjust the framework for specific needs. I start to fight with the framework instead of writing the actual code
  3. It is hard for others to dive in quickly. Sometimes, much less experienced developers are working with me and I want them to be able to make changes without going through 200 tutorial videos.

Would I need all this complexity in my small private projects? Ehm, probably, not. In my company’s medium-sized projects? No, I don’t think so. In a big enterprise-sized apps where 10 teams are working on the same app? Yes, maybe, then all this complexity/modularity/precompilation is a good thing. But also maybe if these teams decide to use some other framework, then they might not need so many people working on it ;-)

I could understand all this complexity if it was impossible to make a good stable webapp without it. But as we all know, it is possible and even easier. Just take a look on other frameworks like Vue.js (my current favourite) or on something React-based.

P. S. Adam added a good comment against my points I’d generally recommend reading as well if you wanna look on the opposite side of the story :-)