CoffeeScript is a nice little programming language that compiles into Javascript. It exists to make life easier for Javascript programmers, and it achieves this by removing a lot of clutter and adding some nice syntactic sugar. At the same time, it stays close enough to Javascript to avoid the "impedance mismatch" other systems like GWT often suffer from: It does not change how anything works, there is no need for a special runtime library, you can call into (and be called from) any "regular" Javascript code, and the resulting Javascript is still readable and corresponds very closely to the CoffeeScript it was compiled from (which is good when you need to debug it). In fact, you are supposed to understand the transformations it does, and why. The Principle of Least Surprises is in effect, and the programmer stays in control.
Less clutter: CoffeeScript does away with most of Javascript's braces, parentheses, and semicolons. Especially when defining functions (which you will do a lot for example when working with callback-driven frameworks like node.js) and object literals, this really reduces the amount you have to type a lot. At the same time, this also reduces the amount you have to read, so once you get used to it, it should be easier to understand as well. The one thing that I am a bit uncomfortable here is that whitespace (in the form of indentation and line breaks) becomes significant, just like it does in Python. I found that it does actually align nicely with how I want to layout my code anyway, but I am a little worried about some hard-to-understand errors this might cause.
Syntactic sugar: CoffeeScript claims to have taken inspiration for these constructs
from Python and Ruby, but I'd like to point out that those in turn have inherited them
from Perl. In any case, it is very nice to have multi-line strings, string interpolation,
array slicing,
trailing if statements, and keywords like not or unless.
There are also constructs to work with Javascript's prototype-based object system,
with the frequent issue of context changes (this not being what you want it do be),
and for looping over lists:
shortNames = (name for name in list when name.length < 5) alert message for message in ['foo', 'bar', 'baz']





