

Knockout.js vs Backbone.js - fuzzythinker
http://stackoverflow.com/questions/5112899/knockout-js-vs-backbone-js-vs

======
thegooley
I've been using Backbone at Earbits (YC w11) [1] since February and have been
very happy with it. We're running a pretty complex AJAX app that streams music
along with providing a large set of functionality around the music itself
(artist info, local concert alerts, track history, deep facebook integration,
bookmarking favorites, event logging, running contests and promotions and so
on).

For an idea of scale, we have: ~60 backbone views, ~120 javascript templates
(underscore jst), ~30 backbone models + collections, 1 controller (the router)

And we have a fairly complex system of white-labeling that allows us to swap
out javascript templates and augment view functionality for partner sites [2]
and local sites [3] without adding a lot of overhead.

The combination of Backbone + Underscore + Jammit with Rails/Rack on the
backend is working great. Even developers who are not familiar at all with
Backbone and the ajax app, can dive in and understand everything pretty
quickly.

Can't possibly recommend it highly enough, if you 1) are comfortable with
Javascript, and 2) prefer to roll most of your own code so that you're not
beholden to bulky rigid frameworks.

There are some quirks that annoy me, but overall I can't complain. One of
these days when I have some more free time, I'll try and write a series of
posts explaining how we're using it and our key learnings.

[1] <http://earbits.com> [2] <http://sfgate.earbits.com> [3]
<http://la.earbits.com>

------
msy
The real competition to Backbone in this space in my mind is Sproutcore 2. At
its core it's lightweight enough to be a drop-in replacement but has a vastly
more sophisticated approach to handling dom updates, cascades of updates, data
bindings and dealing with large sets of data.

------
Pewpewarrows
Every time I would try to learn and like Knockout.js, I was always put-off and
immediately stopped from disgust after seeing all the data-bind attributes all
over the place, destroying the separation between presentation and business
logic.

But, after reading some of those answers, I'm very happy to see that you can
now work with a fork of "unobtrusive" knockout. I'll definitely have to give
it another chance.

------
huskyr
I would recommend looking at Spine as well:

<http://maccman.github.com/spine/>

It's smaller than Backbone and IMHO also makes you write cleaner code. It has
real controllers as well. Backbone has routes instead which works for a data-
driven page-based application (say a CMS or something) but doesn't work that
well for more GUI-like stuff (like a media player).

Unfortunately it doesn't have a big community and many users like Backbone.

------
bergie
I'm happily using Backbone.js on several projects on the client side,
including with VIE: <https://github.com/bergie/VIE>

One of the cool things is that Backbone models and views can be quite easily
used also on the server-side with Node.js. In some applications both sides use
the same models, with Backbone.sync being the difference - on client you
communicate with AJAX, on server you communicate with a custom database
connector.

------
grandalf
I wish someone would write a very simple databinding helper to let backbone do
some of that ultra easy UI databinding too.

~~~
EdwardMSmith
Check out backbone-modelbinding:
<https://github.com/derickbailey/backbone.modelbinding>

------
AmaralHerberth
So far, I've seen every Knockout feature implemented directly or indirectly
(via plugins) in Backbone.js

------
sasha-dv
Thank you for posting this link. I'm in the process of choosing between the
two. So far knockout.js is winning.

~~~
joakin
I'm using Backbone at work to refactor a big project and the one thing I can
tell is that I'm writting a lot of code.

It's coming to be very organized, but it makes the LOC bigger.

Also for starters I suggest that you have a look at some dependency management
library like requireJS, if your code base its going to be big, you better get
started with dependency management.

Good luck!

~~~
sasha-dv
Thanks.

I'm working on a small project and while the code I'll write is small, my
stack is rather colorful.

------
tstyle
Why is the ordering of answers so messed up on this particular stackoverflow
question?

------
diptanu
I think Batman.js(by the Shopify guys) would be a good competitor in the space
too.

