Happy birthday, CoffeeScript

written by
CoffeeScript is a great language, but more than that, it's an invitation to think and dream about our ideal developer experience. And then to make that dream into a reality.

Yesterday, Jeremy Ashkenas gave all of us a little Christmas present and released CoffeeScript 1.0, precisely one year after its first release, 0.1.

CoffeeScript is a language inspired on Python and Ruby, which compiles into Javascript. Yes, Javascript.

The language itself is wonderful: it feels like the best parts of Python and Ruby thrown together. More OO than Python. Not filled with sigils like Ruby, or, god forbid, Perl. Terse, but readable. Meaningful whitespace. Groovy-like safe navigation . And a lot of stuff that should have been in Javascript a long time ago, but isn’t: comprehensions (well…), string formatting, default arguments, heck, even a better syntax for multiline strings.

But it’s not really about the language. Not entirely, anyway.

CoffeeScript isn’t an appropriate JavaScript-Next candidate, because it doesn’t go far enough: it’s entirely limited to what’s possible to achieve on lowest-common-denominator JS engines. Which, in practice, means that it’s limited to all the quirks and bugs of JScript in IE6. (Jeremy Ashkenas over at Sam Ruby’s blog)

CoffeeScript is exciting because of what the language means for web development.

In tandem with node.js or Rhino , Javascript already gave us the opportunity to code an entire web application, back-end and front-end, in one language. Replace Javascript with CoffeeScript, and now you can actually enjoy the process . CoffeeScript is a language you’ll actually willingly code in, not just because you have to.

But a one-language stack is not what’s so exciting either. More than that, the CoffeeScript/Node combo is an opportunity for our generation to create a programming language ecosystem that’s exactly the way we want it to be. As Alex Payne acutely observed this summer, a software project can be exciting for more than just technical reasons. Technically, Node is asynchronous to the bone. And that’s neat, but really, synchronous programming was working out just fine for most of us most of the time. Projects like CoffeeScript and node.js speak to our imagination because

People in the Node community are having a good time reinventing the familiar wheels of web frameworks, package management, testing libraries, etc., and I don’t begrudge them that. Every programming community reinvents those things to their norms. (Alex Payne)

Because sometimes, reinventing stuff actually does make sense. And it’s fun, even for those of us only participating on the sidelines. It’s a hype, but it’s a good kind of hype.

The ecosystem that surrounds Javascript lacks a standard library, heck, even lacks firm standards for loading modules or reading from files. And that’s actually a good thing. It gets us thinking. It’s an invitation to start coding. To reimagine what package management should mean, how deployment should work, what a web framework should look like in 2011. To create new and better interfaces for pedestrian functionality like an HTTP library. We might end up repeating a lot of past mistakes, we might go down the wrong path here and there, but along the way, we’ll learn. The way we do web development will be better for it.

So, if you find yourself with some idle time in between end-of-year festivities, read through the docs at http://jashkenas.github.com/coffee-script/ , get cracking on a <script type="text/coffeescript"> script in the browser, an express.js app in node.js, or a CoffeeApp.

Enjoy.

share on twitter

Happy birthday, CoffeeScript stdout.be/2b by @stdbrouw


Stijn Debrouwere works at The Guardian in London. This blog is about computer code and the future of journalism. Stijn is @stdbrouw on Twitter.

Related conversations