

Underscore.coffee - m0th87
http://jashkenas.github.com/coffee-script/documentation/docs/underscore.html

======
m0th87
This is the coffeescript version of underscore.js.

BTW, these beautiful documentation webpages are auto-generated with a tool, as
pointed out in the underscore.js post:
<http://news.ycombinator.com/item?id=1767897>

There are equivalents for several languages.

------
jashkenas
Cautionary note: this version is slightly out of date, and needs to be updated
to reflect the changes in Underscore 1.1.1 ...

~~~
SupremumLimit
It's probably worth noting that you can just use the original Underscore.js in
your CoffeeScripts, which solves the problem with being out of date.

Underscore.coffee is a good demo of CoffeeScript though.

------
jrockway
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.

~~~
jashkenas
I 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>

Or, to take an extreme example -- this one:

[http://jashkenas.github.com/coffee-
script/documentation/docs...](http://jashkenas.github.com/coffee-
script/documentation/docs/rewriter.html)

... 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
Literate programming is useful, but not when the commentary is "the function
createMeAFoo creates me a foo".

