Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • October 26, 2016, 12:16:49 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Geek fun: If famous authors wrote JavaScript  (Read 997 times)


  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,764
    • View Profile
    • Donate to Member
Geek fun: If famous authors wrote JavaScript
« on: July 10, 2013, 08:05:01 AM »
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…

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.

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:


  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,550
    • View Profile
    • Donate to Member
Re: Geek fun: If famous authors wrote JavaScript
« Reply #1 on: July 10, 2013, 10:36:24 AM »

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.