Наткнулся на замечательную 18-страничную
ветку на stackoverflow, посвященную лучшим комментариям, встреченным программистами в кодах программ. Перепечатываю самые выдающиеся :)
//This code sucks, you know it and I know it.
//Move on and call me an idiot later.
// drunk, fix later
return 1; # returns 1
i++; // increase i by 1
return null; //Not really null
Catch (Exception e) {
//who cares?
}
catch (Ex as Exception)
{
// oh crap, we should do something.
}
// If this comment is removed the program will blow up
/* Halley's comment */
// I dedicate all this code, all my work, to my wife, Darlene, who will
// have to support me and our three children and the dog once it gets
// released into the public.
//Abandon all hope yea who enter beyond this point
// human madable inconvenient. Way too sucks.
// I know the line below is wrong, but it came that way from our IP vendor, and
// the driver won't work if you "fix" it. I've had to revert this change 4 times
// now. Leave it alone, or I will hunt you down and hurt you
// I don't know why I need this, but it stops the people being upside-down
x = -x;
// This procedure is really good for your dorsolateral prefrontal cortex.
'Do not optimize these next two lines. Compiler bugs lurk.
// TODO make this work
All bugs added by David S. Miller davem@redhat.com
// left as an exercise for the reader
//When I wrote this, only God and I understood what I was doing
//Now, God only knows
ICantBelieveImUsingAGoto:
/**
* Always returns true.
*/
public boolean isAvailable() {
return false;
}
//
// 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
//
// Hey, your shoe's untied!
//Haleluya i can go home!
long long ago; /* in a galaxy far far away */
/* Ah ah ah! You'll never understand why this one works. */
/**
* If you don't understand this code, you should be flipping burgers instead.
*/
// If this code works, it was written by Paul DiLascia. If not, I don't know who wrote it
// For the sins I am about to commit, may James Gosling forgive me
// This will save us ~0.5 sec for every user and please the machine spirits.
// I put on my robe and wizard hat...
#define TRUE FALSE
//Happy debugging suckers
// The world is a happy place.
//todo: never to be implemented
In a GIGANTIC 800 line 'switch' statement, somewhere in the middle:
// Joe is sorry
A few hundred lines later...
// Harry is sorry too
This seems to stop morons from messing my code...
// Autogenerated, do not edit. All changes will be undone.
// TODO: Fix this. Fix what?