Friday, September 14, 2012

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



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



2.
// I am not responsible of this code.
// They made me write it, against my will.



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



4.
//Dear future me. Please forgive me.
//I can't even begin to express how sorry I am.



5.
/*
 * You may think you know what the following code does.
 * But you don’t. Trust me.
 * Fiddle with it, and you’ll spend many a sleepless
 * Night cursing the moment you thought you’d be clever
 * Enough to "optimize" the code below.
 * Now close this file and go play with something else.
 */



6.
#Christmas tree initializer 
    toConnect = [  ] 
    toRead =   [        ] 
    toWrite = [           ]  
    primes = [               ] 
    responses =  {} 
    remaining =   {}



7.
double penetration; // ouch



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



9.
# To understand recursion, see the bottom of this file

At the bottom of the file:
# To understand recursion, see the top of this file



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



11.
//
// 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 = 42
//
.


12.
/**
* For the brave souls who get this far: You are the chosen ones,
* the valiant knights of programming who toil away, without rest,
* fixing our most awful code. To you, true saviours, kings of men,
* I say this: never gonna give you up, never gonna let you down,
* never gonna run around and desert you. Never gonna make you cry,
* never gonna say goodbye. Never gonna tell a lie and hurt you.
*/