Reading Code

I recently spent some time getting to know backbone.js. I wanted to apply it to a mobile app I have been working on. While the code is great, I stumbled on an idea while using it. When I fist start using a framework of any kind, django for example, I almost always use there getting started tutorial.

You copy, and paste the code from this tutorial, and then poke and prod it until you get some kind of understand of the code. When I was working with backbone.js though, I could not find a single in-depth tutorial that was close to what I wanted. In fact, it was hard to find anything more then just sample code.

Backbone it’s self is well written, and all of the code is precisely documented, but only at the atomic level. Each individual function has been lovingly document, but its hard to find a 90,000 foot view that is more then: oh, here is a todo list.

To figure out how to do what I wanted, I had to start digging into the code. I haven’t ever really started using a framework in that manner before. At the end of a long session working with the code I realized that i had a better understanding of backbone, quicker, then almost any framework I have used.

It might just be that as I code more, I am more easily able to understand code, but I think it might also be how I approached learning backbone. By letting the code be my guide, and really trying to understand the intent I was able to gain a meta level understanding of what the code creators were trying to get across.

PS. Javascript projects can we stop putting .js in the name. Every-time I type a period in a name I feel dirty.