Writing runnable code is the essential skill of a programmer, writing understandable comment is also a skill a programmer should acquire. There is some famous saying that bad comment is worth than no comment. Usually your code will be maintained by other people, if you provide them some difficult to understand or misguided comments, this will be nightmare to them. While at some other time, programmers may put some funny comments in their codes which may make others laugh. Today we share some comments which are full of humor.
1. Send some warning to maintainer
// // 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 //
2. Mercy on the next maintainer
// When I wrote this, only God and I understood what I was doing // Now, God only knows
3. Complaint about compiler
// sometimes I believe compiler ignores all my comments
4. Acknowledgement to his/her family
// 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.
5. Better to do it later in this case
// drunk, fix later
6. Not convinced by himself/herself
// Magic. Do not touch.
7. Small trick
#define TRUE FALSE // Happy debugging suckers
8. Good story teller
long long ago; /* in a galaxy far far away */
9. Miss in sync
/** * Always returns true. */ public boolean isAvailable() { return false; }
10. There is really some problem
Exception up = new Exception("Something is really wrong"); throw up; //ha ha
11. Only God knows
//I am not sure why this works but it fixes the problem
12. Comment comment
// somedev1 - 6/7/02 Adding some temporary tracking of Login screen // somedev2 - 5/22/07 Temporary my ass
13. Recursion explained
// To understand recursion, see the bottom of this file At bottom of the file // To understand recursion, see the top of this file
14. Double penetration
double penetration; // ouch
15. Feel sorry now
//Dear future me. Please forgive me. //I can't even begin to express how sorry I am
16. Get away from the blame
// I am not responsible of this code // They made me write it, against my will
17. IE is the victim
// hack for ie browser (assuming that ie is a browser)
18. Famous TODO
// TODO : Fix this. Fix what?
Did you write this kind of comments in your source code before?
Back in the day when I was an IBM 370 BAL programmer (that's IBM 370 Assembler language for all you kiddies out there (and future computational aarcheologists ) the only acceptable comment was an 800 number and an hourly rate.