359
votes

What is the best comment in source code you have ever encountered?

0

518 Answers 518

1
14 15 16 17
18
0
votes

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...

0
votes
(A bunch of code that's really weird looking)  //Kludge.
0
votes

I just found this in some legacy code..

'CANNOT JUST QUIT!
0
votes
// now swap like a <explicative removed>
0
votes
REM Don't delete this print statement ****** will die

The process in question was a service in some legacy code

0
votes
// 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
}
0
votes
// Oh crap, i think i'm gonna yack

followed shortly thereafter by:

// TODO: end this lunacy
0
votes

Some old fortran code I saw:

     integer *4 one,two,three;

c    asssign one to 100 before entering the loop
     one=100;
1
14 15 16 17
18

Not the answer you're looking for? Browse other questions tagged or ask your own question.