3 ms·
I've recently been using CoffeeScript in conjunction with the Ojay wrapper for YUI (http://ojay.othermedia.org http://ojay.othermedia.org), which includes JS.Cl
by gmac 16y ago
I've recently been using CoffeeScript in conjunction with the Ojay wrapper for YUI (http://ojay.othermedia.org http://ojay.othermedia.org), which includes JS.Class ("Ruby-style JavaScript", http://jsclass.jcoglan.com/ http://jsclass.jcoglan.com/).
I've found the combination absolutely brilliant -- it recalls Ruby's creator Matz's promise of a language to "make programmers happy".
You get the expressiveness and brevity of Ruby, plus first-class functions, running in anyone's browser; and you get really well-thought-out event handling, AJAX and animation APIs.
I have only one serious pain-point with CoffeeScript: the Pythonesque significant whitespace. This commonly trips me up when providing anonymous function arguments to other functions (very common when assigning event listeners, for instance).
I guess the problem is that I never really understand exactly which whitespace is going to be deemed significant -- so maybe it's just a matter of documentation?
- jashkenas 16y agoIf you can show me a couple examples of places where the indentation tripped you up, I'd love to fix the documentation to explain them. Either starting a ticket, or gist-ing the examples here would be fine. There was a question in #coffeescript last night about passing multiple anonymous functions into a function, and we came up with a couple of nice ways to write it: http://gist.github.com/479249 http://gist.github.com/479249
- gmac 16y agoThanks. Obviously I've fixed the original problems now, but if I get a chance to try to recreate them I'll be in touch. I should have mentioned that's the other thing to love about CoffeeScript: insanely responsive support!