What is the best comment in source code you have ever encountered?
stackoverflow.com
stackoverflow.com
loop
...
...
// sleep 10
sleep 7 // Changed from "sleep 10" on 11-19-05
// by jvj because Bruce in Buffalo bitched
// that it ran too long. Now he's happy.
// The next time he bitches, change it to
// "sleep 5". That oughta buy us another
// year before we have to rewrite it.
...
...
until done do repeatAlthough I guess the punchline has come before the "joke"...
// somedev1 - 6/7/02 Adding temporary tracking of Login screen
// somedev2 - 5/22/07 Temporary my ass
(http://stackoverflow.com/questions/184618/what-is-the-best-c...)From the SO answer:
This seems to stop morons from messing my code...
// Autogenerated, do not edit. All changes will be undone.
http://stackoverflow.com/questions/184618/what-is-the-best-c...
#Christmas tree initializer
toConnect = []
toRead = [ ]
toWrite = [ ]
primes = [ ]
responses = {}
remaining = {}
http://stackoverflow.com/questions/184618/what-is-the-best-c... char program [1];/* Unwarranted chumminess with compiler. */
First by Dennis Ritchie in his regular expression implementation, and then subsequently copied with the comment intact into all other regular expression implementations ever written.Yeah, I know I should find some other StackExchange site, go there, create an account there, login there, and post this complaint there - but you know, that's just more of the same problem. </rant>
(They may have fixed this recently, but it was like that for the longest time.)
Please note we did force logout globally, network-wide in April 2010 (to mandate emails for Google GMail OpenIDs) and September 10th 2010 (to enable global auth for all users).
Also, we delete any sessions older than 4 months as a matter of course.
So if you visit VERY infrequently, you might run into one of those.
Details:
http://blog.stackoverflow.com/2010/04/openid-one-year-later/ http://blog.stackoverflow.com/2010/09/global-network-auto-lo...
/**
* Today I'm getting discharged from the Army
* Don't have time to properly comment the code
* Call me if you have any questions: Name,054-XXXXXXX
*/ // Michael, this is brilliant!
Yeah, somebody else had complimented a change I'd made a few months earlier. I still maintain that code occasionally, and it's the only comment left I didn't write myself. I leave it there just to get that little ego boost every couple of years.if($_GET["action"] == "score") {//that's what she said
// I got this code from [Bob] of [Some other group].
// I don't know how it works; ask him.
[Bob] happened to be my manager at the time, and hadn't worked for [Some other group] for around five years. if (line[0] == '#') continue; // comment(a PNG-fix for IE6)
// PLEASE READ:
// Absolutely everything in this script is SILLY. I know this. IE's rendering of certain pixels doesn't make sense, so neither does this code!
// I have to put this part in because Ken is a dickFound years ago in Adobe's ActionScript core classes.
/*
* W A R N I N G
*
* If you think you know what all of this code is doing, you are
* probably very mistaken. There be serious and nasty dragons here.
*/$html = parse($html); // the function so nice, he ran it twice
@interface UIScreen (AppleAreAssholes)
+ (CGRect) convertRect:(CGRect)rect toView:(UIView *)view;
@end// This code is pretty dense so I recommend you read the documentation first
Some months later I found a follow-up comment left by a fellow dev:
// Or you could just give up now
# I apologize for how messy this is. Blame it on an inconsistent database structure. I did the best I could.
...
} catch exception {// Failed to load in the proper way
// Attempting to wing it
...
}
//
//How's my coding?
//1-800-NO-ONE-CARES
Although I had trouble coming up with what to say in the phone number. Any suggestions?