ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > Living Room

Geek fun: If famous authors wrote JavaScript


I was going to post this into the Developer's Corner, but it's far too funny (in a geek way) to risk the oblivion that so many good topics seem to experience after being posted there. ;)

It's an article by Twitter engineer Angus Croll posted over on Svbtle entitled:

If Kerouac wrote JavaScript (and Dr Johnson wrote CoffeeScript)

Last summer I introduced the concept of literary JavaScript with If Hemingway wrote JavaScript in which five well known authors wrote a JavaScript utility to generate the Fibonacci sequence. In May I presented their efforts at JSConf 2013, and to mark the occasion I asked an additional six authors (as well as the irrepressible Hemingway) to solve factorial(n) as only they could. Here’s what they sent me…
--- End quote ---

If you know anything at all about JavaScript programming - and have a nodding acquaintance with: Kerouac, Samuel Johnson, James Joyce, Richard Feynman, Arthur Conan Doyle, Jane Austen, or Ernest Hemingway - there's some awfully clever stuff to be found here.

Hemingway's "contribution" is (of course) brief to the point of almost resembling a haiku:

Ernest Hemingway
“When you stop writing JavaScript for fun you may as well be dead”

   function factorial(n) {
     return n < 2 ? 1: factorial(n-1)*n;

Enough said.

--- End quote ---

Some pretty good laughs if you're into this sort of thing. I'm very "up" on the authors mentioned in the article but only mildly up on JavaScript. But even so, there were several places in the article that made me laugh out loud.

Good stuff! See it all here. 8) :Thmbsup:

(Note: "That Hemingway thing" mentioned under Croll's bio block is an earlier article he wrote entitled: If Hemingway wrote JavaScript. It's another fun read that can be found here.) :mrgreen:


So if you stuck them all in a room, Seven Writers In Search of an Algorithm, you'd get something like this?


"So whence it came that it became time to teach the maths, and no Russian Farmer's Child Methods would work, then if you honor, nay worship the Mouser, and have recorded all his fabulossical writings, you would have discerned and divined, the post whereupon he gave his approximate age by elucidating the facts of how long it had been, oh so very long, since ...

Since he was in that tortuous Kafka-esque prison called college, and within that factoid was a number. So if you take that number, which he thus had provided for good and earnest measure, and cross reference it with the square root of your own forum post number, you will have ...

Aw hell with it. We are going to factorial something. But since Fermat was busy and the only known professional Fermat Contacting Medium was busy, the method to factorial is too long to fit into this post, for it is filled with tigers instead, and only the lord and dead Colosseum victims know that Tygers burn bright, and fill the room ...

The end.


[0] Message Index

Go to full version