12 ms·
What's the debugging experience like?
by confuzatron 16y ago
What's the debugging experience like?
- jashkenas 16y agoAs a source-to-source language, we try to keep debugging sane by outputting pretty-printed JavaScript that shouldn't be too hard to debug. For example, dropping you right into the middle of the JavaScript that's generated for the CoffeeScript Lexer looks like this: http://github.com/jashkenas/coffee-script/blob/master/lib/lexer.js#L130 http://github.com/jashkenas/coffee-script/blob/master/lib/le... Pretty readable. You can use a Webkit or Firebug debugger just as you would with normal JS. It's a golden rule (with one small exception) that there are no CoffeeScript-specific constructs or special functions added to the runtime, no matter how tempting it might be to do so. The single largest headache in practice is having to refer to the generated JS if the exception is vague, and just includes a line number. But I'm not sure that there's anything we can do to mitigate that, other than to keep the JS readable...
- karlokeeffe 16y agoThe debugging experience is surprisingly good. CoffeeScript is pretty much a one-to-one conversion into JavaScript. This makes it easy to work out which line of JavaScript was generated by which line of CoffeeScript, and debug the CoffeeScript directly. I find I don't often need to look at the compiled JavaScript very often, but it is perfectly readable to do so if required.