3 ms·
There are a lot of not-so-great blog posts and tutorials out there for Backbone, so I'm not entirely surprised to hear that you found them "useless". It would
by jashkenas 15y ago
There are a lot of not-so-great blog posts and tutorials out there for Backbone, so I'm not entirely surprised to hear that you found them "useless".
It would be great to have a more step-by-step in-depth tutorial available on Backbonejs.org, and if I don't get a chance to built one out soon, I'd be glad to merge a branch that adds one.
Tutorials aside, is there something more in the way of API documentation you'd like to see, that you aren't finding on Backbonejs.org?
Finally, there is a long list of real-world apps available, many of which have viewable source code that you can examine and learn from:
http://backbonejs.org/#examples http://backbonejs.org/#examples
... and DocumentCloud.org, the original application from which Backbone was extracted, has all of its JavaScript available on GitHub:
https://github.com/documentcloud/documentcloud/tree/master/public/javascripts https://github.com/documentcloud/documentcloud/tree/master/p...
- ashchristopher 15y agoI think part of the problem is also that Backbone made some backwards incompatible changes as the framework developed. I found that a lot of the backbone tutorials were out of date - the &Yet blog had a bunch of good tutorials but were quickly out of date, and the posts were never revisited.
- peregrine 15y agoPart of the problem is that everything is in paragraph form. So for instance the http://documentcloud.github.com/backbone/#Model-fetch http://documentcloud.github.com/backbone/#Model-fetch explains in a paragraph that it updates the object and fires a 'change' event. Right below in http://documentcloud.github.com/backbone/#Model-save http://documentcloud.github.com/backbone/#Model-save the text explains how the backbone.sync handles the save function. What's sets me back is that the backbone.sync strings "change" and "update" are both quoted and highlighted just like an "event". It is not apparent from the method call if an event is ever fired. Upon careful inspection you notice it also calls set if the values are passed or values are returned differently. The set method triggers a change event. Eventually these things become second nature and you just know them. The tricky part is finding a good place to start from. Maybe a list of good practices, maybe a good up to date tutorial showing a simple app that uses models, collections, views, routes, and a real backbone.sync.
- jashkenas 15y agoAh, sorry. In that particular example, all of the highlighted strings: "change", "create", "update", are all JavaScript strings. We should fix the Model#save paragraph to make it clearer that the strings are the potential values of the "method" parameter.
- peregrine 15y agoNo problem, you asked for specific examples, and I figured since I'm writing my first large production backbone.js code I should chime in on my experiences. Thanks for all the great work! I use and love BB, CS and _ everyday.
- sophacles 15y agoI've always thought a bit more explanation up-front about the philosophy, the way high level components/concepts interact, and the use cases would really help with backbone. The API is decently documented, but the context is not so well documented, and sometimes that is more important than the functions themselves (I can read code, but I don't want puzzle out which things that are technically allowed are bad/good practice within the lib's architecture). edit/note: its been about 6-8 months since I was looking at backbone hard, so this may have improved.
- drewda 15y agoI've enjoyed reading the Backbone docs and found them useful reference. Actually, I quite enjoy reading all of your project docs, @jashkenas! But I wish the Backbone docs would talk about how to structure larger applications. Yes, I agree with the philosophy of "There's More Than One Way To Do It" but I don't think that's a good reason for the fact that there is no recommended best practice for how to modularize and organize code for a Backbone app that's larger than the trivial to-do example. Some discussion of architecture for larger apps, along with some example code, would be great. At present it's an annoying contrast to see the small to-do example and the screenshots of elaborate examples that have many models, collections, routes, etc. Would be great if the docs could do a better job bridging the two.