Funny source code/documentation/comments?

Started by
75 comments, last by jonaakey 10 years ago
Background: my advanced data structures professor is in the annoying habit of giving us extra-credit questions in the form of fill-in-the-blanks from the voluminous C++ Standard. He claims that so far everyone our 27-person class has yet to produce a single correct answer, and that he was going to double the point value for each week that went by where no one got the answer correct. (I was speculating that we could, as a class, subvert this system by deliberately failing each question until the final quiz, and then cashing in a points bonanza. But then he capped the point limit at no more than the value of half the quiz. Bastard.) Anyhow, this led me to check out a copy of the C++ (ISO 14882) standard from our library and perusing it in the hopes that the right phrase would stick. That's when I came across this limerick in section 14.7.3: When writing a specialization, Be careful about its location, Else to make it compile Will be such a trial As to kindle its self-immolation. I'm sure you guys have encountered similarly amusing snippets, documentation, or comment fragments. Any recent finds of noteworthiness?
- k2"Choose a job you love, and you'll never have to work a day in your life." — Confucius"Logic will get you from A to B. Imagination will get you everywhere." — Albert Einstein"Money is the most egalitarian force in society. It confers power on whoever holds it." — Roger Starr{General Programming Forum FAQ} | {Blog/Journal} | {[email=kkaitan at gmail dot com]e-mail me[/email]} | {excellent webhosting}
Advertisement
Well, I'm always a fan of:
//what the hell does this do???

I found one in some stuff at work along the lines of
//Shit the bits

Missing an "f" gives the code a whole new meaning. We caught that one in our code inspection.[wink]
______________________________"Man is born free, and everywhere he is in chains" - J.J. Rousseau
SDL_Surface* Screen; // Main Screen Turn On


This is the funniest comment I've ever put in my code, which demonstrates quite well how unfunny I really am.
"Sir, it is pie." - Mark TwainThe ArchWizard's site.
cold_steel: isnt that from the half life 2 sdk? lol i remember seeing that

-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
In the linux source code there is a comment saying something along the lines of, "Fuck me gently with a chainsaw."
______________________________________________________________________________________With the flesh of a cow.
It's also amusing when you come across a huge block comment that describes why a line of code exists, and after reading it you're left utterly confused and still wondering why the line exists. Then you remove it, encounter problems, redebug the thing, add the line again with a new explanation, and a while later wonder why the line is there again.

Quote:Original post by Ainokea
In the linux source code there is a comment saying something along the lines of, "Fuck me gently with a chainsaw."


That's such a stupid saying, but it's used so often.

Mine are usually funny at the stupidity of them.

// Initialization Function
DWORD Initialize();
the future is just like the past, just later. - TANSTAAFL
I remember going through some Xbox Live code for dealing with friend requests, and on detecting a new pending friend request there was the comment

// Someone wants to be our friend. Aww.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

I've come across an infinite loop that was commented:
//Until the cows come home...
along with a function called 'milk_the_cows'. (No this program had nothing to do with animals)
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms
Quote:Original post by ArchWizard
SDL_Surface* Screen; // Main Screen Turn On


This is the funniest comment I've ever put in my code, which demonstrates quite well how unfunny I really am.


I've done the equivalent. Actually, I had several lines of AYB commenting in a row for various subsystems. :)

Anyway. c2.com > k^2. Sorry.

This topic is closed to new replies.

Advertisement