A few weeks ago i was passing by a conference hall packed with excited developers listening to a speaker talking about Angular 1.x, and i was thinking, what a waste of time. Knowing the state of the web, i can't believe people are still going to Angular 1.x events.

Angular 1.x works for many scenarios, and it is good and intuitive for small projects, but it is an architectural mess that will make you cry like a baby on big projects, and that is why it was rewritten completely in version 2.0, in favor of a more solid component-based approach.

Apparently i am not the only one thinking this way:

Why you should not use angularjs

Angular js - the bad parts

What is wrong with Angular

The problem with Angular

2 Years with Angular

My own experience with Angular 1.x was on a big, interactive music composition web app, and i have seen all the architectural horrors (including bad performance), which i am trying to forget. So let's move on.

Component-based frameworks

Maybe you haven't heard or don't value web components, component-based programming and similar, but you should definitely, and unless you are not working on simpler projects you should not waste any more time using MV* frameworks that are rewritten in favor of a better component-based approach (e.g. the rewrite of Angular 1.x to 2.0).

If i was you, i would consider Angular 1.x dead for new projects.

Well, what are the alternatives then? component-based frameworks.

On the last projects @ Ministry of Programming we used a component-based programming approach using React + Flux in a full stack javascript environment, and it is hard to describe all the benefits we got out of that. There are many options. Read on.

The Options

There are many technologies that you can use right now to start with a component-based approach to web development. To name a few:

You can also use the Web Components polyfills http://webcomponents.org/polyfills/.

This is a mixed list of simple/native web-component libraries and frameworks that use a component-based approach, but you will sort it out.

Other frameworks like Ember.js and Knockout are evolving by adopting a lot of the concepts from React and Web Components to get to the next level, so everybody is going in the same direction.

There is also a new framework by Rob Eisenberg called Aurelia.js which definitely looks interesting (thanks to Wesley Overdijk for the reminder in the comments).

Every technology listed has a lot of pros and cons and i will not go into details, but whatever you choose, you will have to re-learn your approach to web programming.

The Benefits

The benefits of a component-based approach to web development are many. First of all natural modularization and reusability which makes your code more mantainable out of the box.

There is also a much better mental model and smaller abstraction gap when mapping UI requirements to actual implementation, since it is easier to think in terms of components and to break down your UI into smaller components that are self-contained. Abstractions like controllers, view-models, scopes, directives and similar are much harder to think about and to map to requirements.

Less abstractions also mean more development productivity and a simpler overall web architecture, which makes it more mantainable and reliable.

"Simplicity is prerequisite for reliability." - E. Dijkstra

The Challenges

The component-based approach to web programming doesn't come without challenges. First of all, there is a new mental model to grasp, which is completely different from the typical MVC or MVVM approach that you used, so you will have to learn a lot.

There is not a migration path from most existing frameworks, which is definitely an issue, since you clients usually don't care about refactoring.

Another problem is limited reusability, because you will not be able to reuse components built in e.g. React in an Angular 2 project, unless you are using the web components standard directly.

There is also a problem of architectural maturity since most web-component frameworks don't have clear architectural recommendations for organizing complex applications, especially in the area of messaging between components, organizing complex component hierarchies etc. Facebook invented Flux as an attempt to resolve those challenges, but it is not simple and you will have a hard time to get it right. Facebook is also experimenting with an alternative architecture called Relay to make things simpler.

Native web-components are still not supported cross-browser (IE is trailing), but that will change soon, and it can be resolved with polyfills.

http://caniuse.com/#search=components

The Conclusion

Component-based frameworks are ready, and you should start using them right now even if they are not perfect. You can choose your flavor of component-based frameworks or work directly with web-component, whatever you like and supports your requirements, but please, stop using Angular 1.x for new projects.