Monday, May 18, 2009

What's The Best Comment In Source Code You've Seen?

Came across a website some time ago, with a list of "What's the best comment in source code you ever encountered?"

And I think it really contain some comedic gems...

So I've extract some of the best parts and put it here.

Oh yeah, this post is for programmers only.

Non-programmers probably won't catch the joke.

My personal favourite is the "Me and God" one... Haha. I'm going to try putting that next time.



//You are not expected to understand this



double penetration; // ouch



//Abandon all hope yea who enter beyond this point



// If you're reading this, that means you have been put in charge of my previous project. I am so, so sorry for you. God speed.



// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 16



//When I wrote this, only God and I understood what I was doing
//Now, God only knows



/*
* You may think you know what the following code does.
* But you dont. Trust me.
* Fiddle with it, and youll spend many a sleepless
* night cursing the moment you thought youd be clever
* enough to "optimize" the code below.
* Now close this file and go play with something else.
*/



/**
* Always returns true.
*/
public boolean isAvailable() {
return false;
}



// I am not sure if we need this, but too scared to delete.




// I am not responsible of this code.
// They made me write it, against my will.



long john; // silver



int counter;
//11/15/08 13:21 It's a counter
//11/16/08 14:13 Obviously. Could you be more specific?
//11/16/08 14:22 It's for a loop
//11/16/08 14:41 WHICH LOOP??
//11/16/08 15:05 Hm... doesn't look like it's used anywhere in this program
//11/17/08 09:28 Well what I want to know is why it's defined in the first place then
//11/17/08 10:01 What I want to know is why we've spent so much time trying to figure out the purpose of one line of code as simple as "int counter;"



Exception up = new Exception("Something is really wrong.");
throw up; //ha ha



When doing my A Level computing course we had a book, in the book the glossary contained two entries:
Endless Loop - See 'Loop, Endless'
Loop, Endless - See 'Endless Loop'



//Dear future me. Please forgive me.
//I can't even begin to express how sorry I am.

No comments: