Mike Jansen

BackboneConf in Review

May 31, 2012

Over the past 7-8 months, I've spent a fair amount of time writing and test driving JavaScript using Backbone.js, in client work and in my own projects. As I got more familiar with the framework, I became pleased with how easy it was to test JavaScript with the structure Backbone provides and became more curious with how others approached using and testing their JavaScript.

This is why I've spent the past two days I've been Boston attending BackboneConf, a conference ostensibly based on the popular JavaScript framework Backbone.js. It seems like a conference named BackboneConf should be, you know, about Backbone, but there were also sessions on Ember.js, Angular.js, and YUI too (even a little Dojo thrown in).

What is the Idea behind BackboneConf?

What I came to realize over the past two days is that while Backbone is certainly a popular framework, it's not the only reason people signed up. In my mind the conference attracted as many people as it did not just because of Backbone, but because people are fed up with lousy JavaScript. When you develop a complex application, you end up with a mess if you don't have some way to structure your code. Backbone is a vehicle for better code, along with all of the other emerging JS frameworks out there. It's not a guarantee of better code, but it's a step in the right direction compared to a single JS file that loads on document ready.

This desire for better code brought this conference together, and it was great to see this show up in the talks and in the attendees. I met quite a few folks that are as enthusiastic as I am about test driving JavaScript (and a few that are interested, too), which made for some great conversations.

As far as the talks go, I won't do a complete rundown but there are a few I'd like to mention:

Client Code and Server Code

Henrik Joreteg's presentation on creating real time apps with Backbone discussed many things, but among them the idea of sharing code between your server and client. Having written such a framework himself in the past, he's come to the realization now that the real benefits of code sharing are pretty minimal. His best slide sums it up as such:

Client and server are much different problems and should be treated as such.

Dependency Injection and Testing

Vojta Jína, one of the contributors to Angular.js, used his presentation to give a live demo of building out a todo list with Angular, and it was impressive how easy it was to add the functionality. What really intrigued me though is the time he devoted to covering how he writes tests for his Angular apps. He talked a lot about the value of dependency injection for easy testability, which leads to better design of his application. It was great to see someone so passionate about code quality and tests up there on day one.

GOOS, Design Patterns, and TDD

The best talk of the entire conference, though, was also the last talk. Brandon Keepers of Github gave his presentation on treating JavaScript like a real language, which means using practices like TDD and applying design patterns to make the code easy to maintain. He walked through refactoring a "simple" function that made an ajax call on event trigger based on input in a form, turning it into Backbone objects along the way. The original function had no less than 6 responsibilities, yet the end result was system and unit tested, with responsibilities split into separate objects that were easier to manage.

The talk itself touched on a lot of deeply interesting topics, and I recommend referencing the slides to get the full experience. For those interested in TDD and good design after seeing the slides or the presentation, but don't really know where to start, some books that Brandon recommends (and I second) are:

The other thing I will add is that learning how to properly TDD is difficult - if you know someone that does practice it, find them and pair with them! They are probably very open to pairing already and willing to help out, and they can give you a great jump start into adopting these practices

Next Year

This was definitely a conference worth attending - I just went through my top three talks and didn't even get to Jeremy Ashkenas' keynote, or Alex Sexton's talk on using RequireJS.

It will be very interesting to see what the conference is like next year - I can imagine that only more and more people will get fed up with the wrong way of writing JavaScript and start to seek out alternatives, which could lead to an even bigger crowd next time.

Thanks very much to Bocoup for hosting the conference and for everyone I met that made the conference so enjoyable.

Back Home