I don't remember it verbatim, or even what exactly the code was doing, but something like:<p><pre><code> // And now ladies and gentlemen, we need a volunteer from the audience!
// Yes, you there, please come up.
...allocate dynamic memory...
// Now our lovely lady from the audience will enter this mysterious box!
...do something with allocated memory...
// We spin the box around!
... do more stuff ...
// And when we open the box, we see she has vanished!
... deallocate memory ...
</code></pre>
Amusing, I guess, but it really didn't contribute understanding to the code. This was in the middle of a gigantic avionics simulation program that was almost entirely uncommented and extremely hard to understand in the first place. The same code base also had an MP3 recording of this song checked into it:<p><a href="http://lyrics.wikia.com/Frank_Hayes:Threes" rel="nofollow">http://lyrics.wikia.com/Frank_Hayes:Threes</a>
Paraphased but<p>if(thingthatshouldneverhappen)
{alert('Oh shit!');}<p>Guess what happened in the middle of a regional training?<p>At least it was easy to find for debugging...
I also remember someone from the early Google team wrote that the founders' code wasn't all that great.<p>>One Google engineer from back then says the most remarkable thing about the co-founders' code was that when it broke, users would see funny error message: "Whoa, horsey!"<p><a href="http://www.businessinsider.com/larry-page-sergy-brin-are-lousy-coders-2013-10#ixzz3VWhAmsSY" rel="nofollow">http://www.businessinsider.com/larry-page-sergy-brin-are-lou...</a>
"// SagePay is a bit of hack on my framework"<p>Said framework also looking at lot like one big blob of hacked together tangle of PHP and HTML.
Not super funny, but pretty cool/weird stuff in a project I inherited:<p>app <- -> exports.setup = it<p>in LiveScript seems to compile to<p>(function(it){
return exports.setup = it;
})(function(app){})<p>which is pretty crazy.<p>Another one, just above some code making many deep monkey-patches to the Sequilize db driver:<p>/* HOLY FUCK THIS IS THE SKETCHIEST THING EVER */<p>made me smile.