Writing CoffeeScript instead of JavaScript feels like I’m fighting a whole new
battle. JavaScript is not a verbose language. Writing JavaScript properly, and
in an OO manner, requires you to be verbose. What I like best is that
CoffeeScript is simply…spartan.

I’m most excited about how accessible functions have become in CoffeeScript, and
how the worry of doing _.bindAll to keep the current object in this just
vanishes. Even our old friend $(document).ready loses a few pounds of syntax
weight:

$ ->
new ItemsRouter()
Backbone.history.start()

It’s ridiculously neat to me that it just works. If you’re doing a loop or
something in a Backbone.View to render many things, you can use the “fat
arrow” to make sure this stays as the current object.

This has been a major concern of mine since we’ve switched. Luckily it hasn’t
been too bad yet, the JavaScript that is generated is actually readable. Of
course, there’s the problem of there’s not a one-to-one mapping between the JS
and CS, but we manage to get by with Sass/CSS just fine.

Not sure why we couldn’t just stick with true and false. There are always
quirky parts to every language, but if I see @item.has("title") == yes in a
pull request I’ll be sending a storm of commit comments.

This tells Barista to look for coffeescripts in app/assets, which hopefully
will make the move to Rails 3.1 a little easier. We’re dumping them into
public/coffeescripts, which is is ignored by git so we don’t check in the
generated files. Finally, there’s some extra unnecessary noise that Barista adds
so the two final configuration options turns that off.

We’re also using Kumade to deploy to
Heroku’s bamboo stack. I’m really hoping this entire situation gets easier in
the next few months, because right now it’s a real annoyance to set up all of
this.

Hopefully this gives you a good overview of the nice additions that CoffeeScript
provides. We talked internally about using CoffeeScript for months before
integrating it. Part of me wishes we had done it sooner, but to really enjoy it
fully you have to understand the problems JavaScript has, especially in a large
codebase.

Huge thanks go out to the folks at DocumentCloud and Jeremy Ashkenas for making
JavaScript application development less painful. There’s plenty of features I
didn’t cover and pages of beautifully documented source code on the project’s
site that you should read.