3 ms·
I'm not really a fan of this literate coffeescript. Most of the code speaks for itself, and the English explanation make the code much harder to follow. It's
by jrockway 16y ago
I'm not really a fan of this literate coffeescript. Most of the code speaks for itself, and the English explanation make the code much harder to follow. It's worse than "add one to i" because at least that doesn't take up multiple lines.
- pjscott 16y agoThose English explanations are just the comments from the original JavaScript version, put in their own column. If anything, this avoids breaking the flow of the code itself.
- jashkenas 16y agoI agree that Underscore's functions are simple/short enough that the commentary doesn't add much. However, do you still think that literate-style documentation isn't helpful for more complicated modules like this one? http://sstephenson.github.com/strscan-js http://sstephenson.github.com/strscan-js Or, to take an extreme example -- this one: http://jashkenas.github.com/coffee-script/documentation/docs/rewriter.html http://jashkenas.github.com/coffee-script/documentation/docs... ... where the code is very detail-oriented, and you need the commentary to convey the "what", and the "why" -- while the code explains the "how".
- jrockway 16y agoLiterate programming is useful, but not when the commentary is "the function createMeAFoo creates me a foo".