top | item 4434553

Ask HN: How to learn Backbone

125 points| robbiet480 | 13 years ago | reply

Backbone Tutorials isn't up to date, a simple "Backbone tutorial" search brings up results from 2011, early 2012. I need to learn 0.9.2 Backbone, not an older version.

Can someone provide me a single resource or multiple great resources to learn Backbone, start to finish (preferably quickly but not mandatory)

33 comments

order
[+] richardofyork|13 years ago|reply
I learned Backbone just about 3 months ago and the first project I built (still in developing) with it was a commercial eCommerce web application for a major client. This is how I learned Backbone:

—— 1. I downloaded a copy of the following book and followed all the examples:

http://addyosmani.github.com/backbone-fundamentals/

Note that the following incomplete sections in the book you will very likely need (I did). The answer to each can be found on StackOverflow.

- Sub-Views And Nesting

- Managing Models In Nested Views

- Views Triggering Other Views

- Cleanly Disposing Views

- [Communicating effectively between views (particularly subviews)]—I added this because I was not sure how to do this after reading the book, I found help on StackOverflow.

By the way, the book is very good and Addy Osmani is a thorough writer, he does not shy away from detail, which I love. Detail is very good, it prevents you from getting stuck later and allows you to have a thorough understanding of the subject matter.

—— 2. Follow these 3 tutorials, they are easy, but very helpful:

http://coenraets.org/blog/2011/12/backbone-js-wine-cellar-tu...

http://coenraets.org/blog/2011/12/backbone-js-wine-cellar-tu...

http://coenraets.org/blog/2011/12/backbone-js-wine-cellar-tu...

— And this one, which is incredibly important for improving your Backbone skills and using Backbone efficiently. These are the things the author later learned on how to improve his preceding 3 tutorials that I listed above:

http://coenraets.org/blog/2012/01/backbone-js-lessons-learne...

—— 3. And StackOverflow will be your God send when you start to develop with backbone and realize that some simple things like communicating beween subviews is not immediately apparent. I also got a few excellent tips from this blog to help me on my way:

http://ricostacruz.com/backbone-patterns/

The commercial application I built is almost complete, I will post a link to it within a few days.

If you follow my guide above, I am confident you would be as equipped as I was to build a serious Backbone.js application without any experience in Backbone.

All the best with your learning and developing.

[+] gee_totes|13 years ago|reply
If the question here is How to learn Backbone, my suggestion would be to take one of the to-do app examples and just build and hack on that until you develop the app you want. Try doing it with just built-in backbone functionality; don't override any of the defaults. Use hacking an already built-app to get a feel for the limitations of the framework, which in turn will show you some interesting (for me, at least, coming from MVC world) design patterns.

If the question here is Where is a good Backbone tutorial, I encourage you to look at the tutorial on Backbone-Relational (which is a plugin for Backbone):

http://antoviaque.org/docs/tutorials/backbone-relational-tut...

[+] davedx|13 years ago|reply
Yes! Coincidentally I was using that tutorial to learn backbone yesterday morning. I found it was a great all-round illustration of how everything ties together. One thing I found quite lacking in other tutorials was how you wire up your front-end backbone app to backend web services. This tutorial demonstrates how you do that very well.
[+] robbiet480|13 years ago|reply
Yes I have looked at the todo application, but I personally learn better with a tutorial. Thank you for the suggestion and the link, I will read in a few hours
[+] braddunbar|13 years ago|reply
Backbone has some of the clearest, most self-explanatory source of any project I've ever worked on. Also, at around 1500 lines of commented code it's a quick read that you can take in all at once (and again later). Also, make sure to read the source in the master branch as well as the annotated docs from the website to keep you informed on the upcoming changes.

I'm not saying that you shouldn't read tutorials, guides, and docs, but you should concentrate most of your effort on taking in the source.

[+] ya3r|13 years ago|reply
[+] robbiet480|13 years ago|reply
Getting there! This is the most useful link so far! Thanks
[+] datashaman|13 years ago|reply
Invaluable resource! Long read but so worth it!
[+] ckuijjer|13 years ago|reply
I really like the step by step nature of his post, starting with an ad hoc jQuery implementation and moving gradually to a Backbone implementation while touching on subjects as separation of responsibilities.
[+] theone|13 years ago|reply
You can start with Addy Osmani's (Backbone fundamentals) http://addyosmani.github.com/backbone-fundamentals/
[+] robbiet480|13 years ago|reply
This looks like a great page, bookmarked, will read in a few hours when I get up
[+] mobweb|13 years ago|reply
Came here to post this. I've actually just started with Backbone a month ago and this was the very best ressource that I found. If you already know a little JavaScript and MVC theory this is perfect.
[+] itayadler|13 years ago|reply
Although this isn't a tutorial, but I thought it was worth mentioning. pragprog.com has released a screencast series on Backbone, by Derek Bailey, the creator of Backbone.Marionette and various other Backbone extensions. I've personally watched the series and gained lots of insight on Backbone thanks to it. (http://pragprog.com/screencasts/v-dback/hands-on-backbone-js)
[+] dustincoates|13 years ago|reply
It isn't quite start to finish, but I've been enjoying Code School's Anatomy of Backbone.js: http://www.codeschool.com/courses/anatomy-of-backbonejs

(Really, in general, I'd highly recommend Code School. Likely too basic for most here, but great to pass along to that person you know just starting out or in the early intermediate stages.)

[+] rglover|13 years ago|reply
Agreed. I read a lot of tutorials, docs, and other info about Backbone. Code school was the first to help me "get it." Soon after walking through the first two chapters, I went and read the infamous annotated todo and everything made sense. Highly recommended.
[+] timc3|13 years ago|reply
Also have a goal in mind. It's probably easier if you want to build X with backbone rather than learn backbone then try and build something.
[+] robbiet480|13 years ago|reply
Yeah I have a very specific goal in mind of what to build, friends are telling me it's perfect for Backbone which is what led me here
[+] some1else|13 years ago|reply
Make composed views, paginated collections, filtering forms, and the like. Although there are now opinionated plugins for these setups, I found that building them myself helped me develop a sense of how to structure views in order to avoid complexity and ambiguity.

The Backbone Docs and it's listed examples are really the best resource out there.

[+] buremba|13 years ago|reply
The best way to learn something is to use it.
[+] prydonius|13 years ago|reply
Yep. I was baffled by backbone tutorials before I actually sat down and decided to get stuck in and try something.
[+] ojr|13 years ago|reply
Look at and read the annotated source, every now and again
[+] jimmytucson|13 years ago|reply
For me, this was the tutorial that finally locked it in: codebyexample.info/2012/03/06/backbone-baby-steps/