AngularJS After Few Days

I work for few days on a new personal project and I decided to use some cool technos.

Backend Rails (I wanted nodejs but I have to go fast and Rails is so good for that), for the database I use MongoDB and a bit of Redis, some websockets and for the frontend usually I love to work with Backbonejs because I know this framework a lot and it is really simple but this time I decided to use AngularJs. I was seduced by the small exemples I did, nothing complicated but a big improvement for productivity.

I just use Angular for few days and so I will try to say what is for me the important differences between Angular and Backbone.

First learning… Backbone is really simple because only based on ‘classical’ use of javascript, some views, a clear model and clear controllers. Angular do many things by itself so some parts are a bit dark like for exemple how views are refreshed or module loaded and stuffs like that.

Start a new project… Here for now I still prefer Backbone but I’m sure it is because I know it more than Angular, I had many problems to start this project with the routes, the binding with the view etc… but I’m pretty sure it’s just because I’m new.

Productivity… When everything is ready, your folders well structured and your application created everything is reaaaaallllly faster. Templates are really easy to use, you can loop on one/many collections, you can even use some templates in a template you can create some complicated stuffs in 5min, when you need perhaps 20 min with backbone.

Debugging… Hum really bad point for Angular… when you have an error you just have a horrible stack, most of the time when you put a breakpoint you cannot see your caller function… really complicated to debug but with Backbone you have almost all the time the same context and functions are really simple. If you have some good tools to debug with Angular I will be happy to try them :)

Maintaining… Because almost all the logic is in the template I’m not sure this is really good to maintain the code even if the logic is really basic because Angular provide many helpfull directives. With Backbone you have to write more (a lot more) but everything is really structured so I’m not sure yet which one is the best one.

In general, many good points for Angular like the possibility to create your own ‘widgets’ and you can use them like a simple html balise this is awesome. The framework is really more complicated than Backbone but also really more powerfull and in fact it is really compliated to compare thoses two framework because just after few days I have the feeling Angular is a real framework and Backbone is like a helper to follow some good practices (I know it’s a bit rude). But even if Backbone is less rich I think you can do more with it than with Angular because have everything done by the framework we should probably find some complications sometimes… I will see.

Comments

Copyright © 2014 - Anthony Estebe -