

Sam Stephenson on Pow, CoffeeScript, and the Rails 3.1 Asset Pipeline - netherland
http://lg.gd/064

======
jashkenas
As someone with a stake in lots of this stuff, this interview is interesting
to listen to. I especially appreciated the bit about 3/4 of the way through
about how doing Docco affected Pow. To quote:

"Pow started out without any documentation. I went through and added the Docco
stuff later.

"I thought it was fascinating the way it actually changed the code. As I would
go through and document things, I would run in to cases where they were too
hard to explain. Something was too hard to explain or looked too awkward. So
I'd refactor it to be more linear, more narrative -- and it matched up with
the documentation, and seemed so much nicer.

"I think that's half the benefit of Docco, and the other half is that it makes
it so much easier for anyone to come in to the project and understand what's
going on and contribute a change."

~~~
stephank
I can attest to that, both from reading and writing code with Docco
documentation.

It's also great IMHO for getting an uncluttered view of code. In many cases,
no matter how well written, the documentation is not enough. And while Docco
is all about documentation, it shines even then.

------
netherland
Sam, creator of Prototype.js: "I hope to never have to write JavaScript
again."

~~~
mrkurt
He could have build Prototype.js in CoffeeScript. :)

~~~
riffraff
unless you meam "rewrite", I guess his time machine was non functional.

~~~
mrkurt
Well he would have had to write CoffeeScript instead of waiting for jashkenas
to build it. He should have, I'm disappointed.

------
devth
One thing that wasn't mentioned was template bundling with sprockets. A
hack/workaround was posted at <https://gist.github.com/989891> but I would
really like to know if there is or will be a recommended way of doing it.

~~~
sstephenson
The latest Sprockets beta has JST support, heavily inspired by Jammit's
approach. Load either the ejs or eco gem in your app, then put a "foo.jst.ejs"
or "foo.jst.eco" in your load path. Require it from JS and you'll be able to
access the compiled template as JST["foo"].

~~~
daveungerer
Cool! I use a version of haml-js that's been modified to work well in the
browser. (<https://github.com/wintondeshong/haml-js>). Jammit allowed me to
set the template function as Haml and it just worked, by passing the content
of the jst files to the Haml() function. Is there an equivalent in sprockets?

UPDATE: As much as I like Haml, I think I'll just switch to eco, since it
seems better integrated for now, and... CoffeeScript! Now all I need is haml-
coffeescript / eco-haml. Well it turns out this does exist:
<https://github.com/9elements/haml-coffee>. But I don't know how much work I'd
need to do to get it working with the sprockets asset pipeline?

------
peteot
"We can put out code that is useful to us that raises the bar, and get people
using it, and we get our bug fixes for free, and our R&D." Maybe the best case
for open sourcing commercial products that I've heard.

------
azrealus
Thanks for a great interview!

I've noticed that the link to Jeremy's twitter account is wrong on your
website.

------
pyrotechnick
I cannot believe this got a mention
<https://github.com/rails/rails/compare/9333ca7...23aa7da>

I do hope GitHubChan becomes a "thing"

