Resources for Learning How to Use Backbone.js
Monday, Sep 16, 2013
Several people have asked me recently for resources to help them get started with Backbone.js. Instead of forwarding the same email again and again, I figured I’d put a post up that I can point people to with some articles that I found really helpful for developing my understanding about the Backbone library. Your mileage may vary with some of these, but give them a shot and see what happens
The first article is actually a step by step walkthrough from jQuery to Backbone. It’s also in a github repo, so I forked it in order to make sure I’d always have a copy (here’s the forked version if you need it). I always recommend this article to start with because the author takes an example that resembles the type of javascript a lot of people start out writing: a simple form with a clickhandler that submits the form to a server. Then, he incrementally transforms it into code using the backbone libraries. It doesn’t go too in-depth with how backbone works, but it’s a good lesson on how to get from point A to point B with your own current code. It’s more important to learn some of the principles he is teaching about separating the view from the data (Model) and the ajax request happening in the background.
The second is actually a 3 part series of articles on Tech.pro. Part 1 goes through some of the supporting constructors in the backbone library. The section on Backbone Events in particular explained a lot of things to me that I was doing even though I didn’t really understand why. Part 2 focuses on the main parts of the library that you’ll be using—Models, Collections, and Views. Part 3 hasn’t been released yet, but will deal with all the aspects of syncing your models and collections back to a REST API on your server. The whole series is turning into a very helpful and thorough analysis of how backbone works.
If there were only two things I could recommend it would be those two. If you need more, here are some other articles I’ve noted:
- Explaining the whole concept of a view and discussing what it should be responsible for (from the same person that wrote the walkthrough I listed first).
- For tutorials you can look at Javascript playground’s tutorial, Getting started with backbone, and http://backbonetutorials.com/.
And obviously, to wrap it all up, there’s Addy Osmani’s Developing Backbone.js Applications book. There aren’t many people better equipped to explain everything than him.
I try to keep most of my backbone-related links on my Pinboard up to date with what I’m reading and find interesting. You can check there for even more resources.