What is the best comment in source code you have ever encountered?
518 Answers
Looking back at old code from classes is fun...
cardDeck.push_back(*(new card((rank)r, (suit)s))); // Push each card onto the deck
// Temp. objects are overrated
While going through some things, it makes me wish I left more comments at 4 AM when I was hacking together random code...
REM Don't delete this print statement ****** will die
The process in question was a service in some legacy code
// long live COM'n'Roll
public enum StatusCode
{
//success codes
S_OK = 1,
S_NONE = 2,
S_SQL_OPERATIONS_LISTS_EMPTY = 3,
//error codes
E_NO_MATCHING_END_FOUND = -1,
E_SEQUENCE_NUMBER_NOT_FOUND_AT_BEGINNING = -2,
E_SEQUENCE_NUMBER_NOT_FOUND_AT_END = -3,
E_FORWARD_AND_BACKWARD_OPS_COUNT_DO_NOT_MATCH = -4,
E_FORWARD_AND_BACKWARD_IDS_DO_NOT_MATCH = -5,
E_IDS_DO_NOT_MATCH = -6
}
// Oh crap, i think i'm gonna yack
followed shortly thereafter by:
// TODO: end this lunacy
Some old fortran code I saw:
integer *4 one,two,three;
c asssign one to 100 before entering the loop
one=100;