What are the pros and cons of Coffeescript?

Posted by Philip on Programmers See other posts from Programmers or by Philip
Published on 2011-04-29T20:14:20Z Indexed on 2011/06/26 0:30 UTC
Read the original article Hit count: 565

Filed under:

Of course one big pro is the amount of syntactic sugar leading to shorter code in a lot of cases. On http://jashkenas.github.com/coffee-script/ there are impressive examples. On the other hand I have doubts that these examples represent code of complex real world applications. In my code for instance I never add functions to bare objects but rather to their prototypes. Moreover the prototype feature is hidden from the user, suggesting classical OOP rather than idiomatic Javascript.

The array comprehension example would look in my code probably like this:

cubes = $.map(list, math.cube); // which is 8 characters less using jQuery...

© Programmers or respective owner

Related posts about JavaScript