Backbone.js – Time for Something New20

Backbone.js logo

Last week I was involved in a discussion which amongst other topics covered working with github and building javascript apps with client-side MVC frameworks such as backbone.js. Whilst I had a vague awareness of both I was unable to contribute very much to the conversation due to a lack of hands-on experience. Feeling rather frustrated by this I decided to grab the bull by the horns and jump straight into building a new backbone app and pushing the source code to github.

Last night, as a result, drinklist was born. The app itself is currently very basic and is neither intended to change the world nor make me famous. What I do however hope is that overtime it will evolve into a respectable code example which will cover some skills that I have not yet found an opportunity to implement in my current job.

The technologies involved in the app are:

The first version of the demo app also includes a to “Still to do…” list which outlines where I hope this learning exercise will take me.

Feedback from any more experienced backbone folk or suggested reading links would be much appreciated.

3 Responses so far...

  • Jörn Zaefferer - 12/21/2011

    As an exercise, try rebuilding the same without most of the dependencies, keeping only jQuery and Bootstrap.There shouldn’t be much of a difference in application code size.

    Before you continue to extend it, move some files around. Structuring by extension is not useful, group by feature instead. Move dependencies into a vendor folder, helpers into a lib folder, feature specific files into an appropiate folder. Not much there yet, but once it starts growing, that’ll help a lot with navigation. Templates, JS and CSS files should share a folder when they’re related.

  • Chris Bewick - 12/21/2011

    Hey Jörn,

    I definitely got the impression working with backbone that it was overkill for an app that’s this simple. It took me considerably longer to build than it would have done to do the same thing in jQuery (which I have done many times before). But considering that it’s a new and unfamiliar framework this was not surprising.

    I am hoping that as I add more functionality to the demo app I will begin to appreciate the benefits of backbone and will be able to develop faster with it than without it… we shall see.

    If not I can always start again and have a play with knockout!

    Thanks for your tips around folder structure. I will look into it.

    Merry Xmas!

  • dani - 02/14/2012

    Thanks for the post,
    helped me, looking foreword for your next upgrade ; )

Why not add your thoughts...