3 ms·
Hey Jeremy, congratulations for the 1.5 release; really awesome stuff there! I'm especially liking the new REPL =D About Literate CoffeeScript, i wonder if it'
by epidemian 14y ago
Hey Jeremy, congratulations for the 1.5 release; really awesome stuff there! I'm especially liking the new REPL =D
About Literate CoffeeScript, i wonder if it'd play nice with moderately complex pieces of code, which, in general, tends to be quite nested/indented. The example on the CoffeeScript compiler, scope.litcoffee[1], looks quite nice, but at the same time it's a fairly simple class; it doesn't need intra-method comments for example.
For more complex pieces of code[2], that make use of comments in fairly indented sections to explain what's going on, do you think the literate style would work too? Or would then make more sense to mix both worlds and use hash-style (#) comments for the more nested bits and literate-style "comments" for describing the more top-level things?
For reading code, i personally really really like the two-column Docco style[3]; the way the comments don't interrupt the code but are there on a side instead. The challenge would be how to see the source code in that nice two-column style while editing :D
Edit: well, phpnode asked basically the same thing regarding indentation (should use F5 more often).
[1]: https://github.com/jashkenas/coffee-script/blob/master/src/scope.litcoffee https://github.com/jashkenas/coffee-script/blob/master/src/s...
[2]: like nodes.coffee: https://github.com/jashkenas/coffee-script/blob/master/src/nodes.coffee https://github.com/jashkenas/coffee-script/blob/master/src/n...
[3]: nodes.coffee post Docco: http://coffeescript.org/documentation/docs/nodes.html http://coffeescript.org/documentation/docs/nodes.html
- jashkenas 14y ago1) Significant whitespace and Markdown-indented code blocks don't really play well together, as now you're operating relative from the indented block, instead of operating from the far left. Ultimately, I think it has a tendency to encourage you to keep things fairly flat, and broken up into smaller methods -- which isn't necessarily a bad thing. 2) I do think it works in heavily indented sections, though -- you just have a single line of prose set off to the left, instead of having a single line set off with a hash. 3) Yep -- I'm hoping to update Docco to parse these files as well, and after that, I'd love to have a nice PDF generator for these, with highlighting and hyperlinks. It's on the list.