Friday, September 24, 2010

// Best source code comment

I stumbled onto this exchange on stackoverflow, regarding great source code comments via WalkingRandomly. Many of them are absolutely precious, some nice (short) ones include:

// sometimes I believe compiler ignores all my comments

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

/* This is O(scary), but seems quick enough in practice. */

// somedev1 - 6/7/02 Adding temporary tracking of Login screen
// somedev2 - 5/22/07 Temporary my ass

#define TRUE FALSE //Happy debugging suckers

/* I did this the other way */

double penetration; // ouch

// I don't know why I need this, but it stops the people being upside-down
x = -x;

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

options.BatchSize = 300; //Madness? THIS IS SPARTA!

// no comments for you
// it was hard to write
// so it should be hard to read

No comments: