
Contrasting Backbone and Angular - vsavkin
http://victorsavkin.com/post/65519559752/contrasting-backbone-and-angular
======
jeswin
I must be in a minority, but I find AngularJS inelegant. I am back to Backbone
and its simplicity. Angular tries to solve declaratively what could be better
solved with JS, HTML and your favorite template engine.

~~~
afandian
I see the dependency injection as the solution to a massive problem I couldn't
see an obvious solution to with Backbone.

~~~
v13inc
What problems do dependency injection solve for you? I haven't had a chance to
use it yet, and I've always been curious about its benefits in real projects.

~~~
camus2
Everytime you pass arguments to a constructor or a method,if the parameter is
itself an object you will call a method on (message passing), you are doing
dependency injection.

So it's a fancy word for a basic idea.

The OP is talking about an IoC container or a service locator. which is a tool
that will wire up and build objects on demand according to a definition. The
alternative is writing factories( ex : document.createElement("DIV") is a
factory method ).

------
edwinnathaniel
Between 3-4 years ago my work was heavily using GWT. We first tried the MVC
pattern but we've always felt that it didn't fit well. We didn't know MVP at
that time until Google I/O mentioned it. We looked at it, we gave it a try,
and it was the perfect fit for the client-side of single-page app.

Maybe MVC with tweak would work too, just rename the Presenter to Controller.
But maybe that is no longer called MVC but MVP-with-name-change.

I'm not big on MVVM (knockout.js) but YMMV.

------
acjohnson55
I've only done a little bit of Angular, but as is widely reported, the docs
were a huge turnoff. The learning curve to build anything is pretty steep,
which is where really solid docs would be crucial.

I've been living in Backbone land for a few months now, on projects without
Marionette, and having looked closely into the Marionette way of doing things,
I think it's pretty much essential to writing maintainable code. I'm in the
process of trying to convert chunks of the app to Marionette, little by
little, and also running a simple home-cooked dependency injection scheme,
which I may blog about once the kinks are all worked out.

For those who've been burnt by Backbone in the past, I really suggest giving
Marionette a shot. It's not perfect, but it standardizes a very clean, very
understandable methodology for building Backbone apps.

------
jlu
Might worth checking out this:

[https://github.com/devmatters/backbone.rocks](https://github.com/devmatters/backbone.rocks)

