3 ms·
What does Knockout, Angular, et al give you that Backbone doesn't? It seems like most of the anti-Backbone comments are about it being unable to "scale", which
by krebby 14y ago
What does Knockout, Angular, et al give you that Backbone doesn't? It seems like most of the anti-Backbone comments are about it being unable to "scale", which is funny considering Hulu, Trello, SoundCloud and about a hundred other very large apps use it just fine. I have yet to see any of the other frameworks deployed to the that scale at all (where are the examples?)
- lucisferre 14y agoWhat they give you actual two-way binding for DOM manipulation and rendering between client and model. They also, generally speaking, place very few requirements on your model which is a very good thing. Angular is exceptionally flexible and one of the first tools for building client-side JS that really impressed me. That said it is fairly complex (and not that well documented) when compared to Backbone, so I can understand why not everyone would be impressed. Cavet emptor. As an alternative Knockout is pretty simple, it's just not my thing. Backbone is a neat tool and what it provides most people is a somewhat predefined structure to work in. Coloring between the lines is really useful. However (as the parent said) it really does very little other than that in the end really. There is almost nothing that Backbone does that a sensible use of jQuery binding and data attributes can't do as well or better. It's just that most people will find it easier to learn Backbone, which is great don't get me wrong, but don't be surprised to find people (like myself) who have moved on. (Also the way model are done is terrible, I've never liked it it always got in the way of whatever I was trying to do.)
- krebby 14y agoTwo-way binding is a neat trick, but I hate that it clutters my markup, and almost always I need to augment it in some way. Backbone's declarative events hash is universally a better way to go for that.
- ganarajpr 14y agoCan you please make any other sane argument other than "it clutters my markup"? You are holding the markup to a standard which seems like there is someone out there handing out "The best clean and clutter free markup" award. End of the day you need to somehow hook up js and html. There is no second question to that. If you shovel out all the shit from html guess where it will land? In your js ( all the dom manipulation code!).
- jtchang 14y agoWhy is it universally a better way? <span data-bind="text: someVariable"></span> may look ugly but it is very clear that there is a variable associated to this DOM element. It took some time getting use to but once I realized how much it made sense I got over it. So tell me about this universally better way to go.
- politician 14y agoThere are plenty of two-way DOM binding add-ons for backbone. OutbackJS makes it work like Knockout, but maps onto backbone models (disclosure: I wrote this one). Most of my models in production apps have zero complexity - a url property is usually all that distinguishes them, and outback bindings means that I a) don't have to litter my code with jQuery nonsense, and b) don't really have to muck with models beyond fetching and saving them. [1] https://github.com/politician/outback https://github.com/politician/outback