Migrating a large JavaScript project from DOM spaghetti to Backbone.js
Backbone.js is not going to solve your DOM spaghetti problems.<p>You will still bind to events, you will still manipulate the DOM, you will still do all the manual work.<p>I really recommend looking at Knockout.js instead.<p>It <i>really</i> gets rid of all the DOM manipulation code that tends to become so complex and spaghetti like.<p>How? It provides a declarative language for two-way binding between the UI and the data.<p>Check out this example: <a href="http://jsfiddle.net/FEVbz/" rel="nofollow">http://jsfiddle.net/FEVbz/</a><p>In the HMTL pane, edit the input boxes and watch as the other DOM elements update automagically.<p>Notice how simple and clean the Javascript code is. All it's doing is initialization and setup. Nothing else. No event binding. No dom manipulation. No spaghetti. No nothing.<p>Shameless plug:<p>Here's an article I wrote about why I think Knockout.js is <i>so</i> much better than Backbone.js<p><a href="http://dev.hasenj.org/post/35572197519" rel="nofollow">http://dev.hasenj.org/post/35572197519</a>