Today I’ve had my first play with CoffeeScript, amazingly it has made JavaScript fun again!

Since learning Ruby, I’ve loved its implied returns, simple string interpolation, lack of brackets and semi-colons, but most of all, I’ve loved how expressive Ruby is as a language. Those simple reasons are why I now prefer to write Ruby than write PHP, it just let’s me do my programming thing easier.

I’ve longed for a way to also be able to do this with JavaScript, I first read about CoffeeScript a while ago but have only just started having a go with it, and boy am I enjoyed in! It let’s me write all my JavaScript without having to write all those brackets and semi-colons. The brilliant thing is too that it compiles into plain old JavaScript. Not only is it just plain JavaScript, chances are its also faster running than any code you write yourself. CoffeeScript is fully Lint compatible and uses a bunch of best practices built write into it. Not only that, but if in the future I ever need to make changes without CoffeeScript, I can do!

So do yourself a favour, check out CoffeeScript right now, I know I won’t be going back!

UPDATE Be sure to check out the excellent CoffeeScript: Accelerated JavaScript Development over on The Pragmatic Bookshelf. I’m about 1/4 of the way through it but so far its excellent!

Published on Saturday, 7 May 2011