Transition to CoffeeScript

Hello dear people!

I haven’t forgot this project. Thanks a lot for all the contributions, I promise to include each of them as soon as I have time! I’m still on my start-up project, www.upcload.com, using a lot NodeJS and CoffeeScript.

One thing I have noticed when reading your bug reports and contributions: Many of the bugs and requests, like the addEdge not returning an edge, or the forEach bug in IE, or the iteration issue over associative arrays, all these problems would not have occured with CoffeeScript.

For those who don’t know this wonderful language yet: It’s just JavaScript, but nicer, more pythonic or lisp-alike. It is a language that compiles to JavaScript, taking care that it will work on most platforms.

What does the transition to CoffeeScript mean to you? Probably not much. You will still get a JavaScript library that is easy to read and debug, containing some comments to get along. Hopefully, you will get more features faster and better quality code with less bugs.

For those of you who want to contribute to Dracula, however,  this means you will have to either edit the Dracula code in CoffeeScript. Or you could just program a plugin in JavaScript, if you like.

Get a small taste of Coffee here:

cubes = (math.cube num for num in list)

This would compile to JavaScript to this monstrous but solid code:

cubes = (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = list.length; _i < _len; _i++) {
num = list[_i];
_results.push(math.cube(num));
}
return _results;
})();
run: cubes

Check this out for more amazing examples: http://jashkenas.github.com/coffee-script/

What do you think about it?

Cheers.

About Johann Philipp

Computer science student.
This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Transition to CoffeeScript

  1. Gaspar says:

    Well. Have you seen this library – http://osteele.com/sources/javascript/functional/ ?

    Quite useful and gives you all bells and whistles you expect from language to write truly functional-style programs :)

  2. Shanti says:

    SpiderMonkey lets you do this:
    cubes = list.map(math.cube)

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht.

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">