The Best of Source Code Comments
2:03 pm in Software development by buzz_lightyear
Well.. do you write comments in your source code? I’m sure you do, but are they funny enough?
Then join the Best Comments in Source Code at Stack Overflow site or at least read it. Your satisfaction is guaranteed :)
Some examples:
/**
* Always returns true.
*/
public boolean isAvailable() {
return false;
}stop(); // Hammertime!
// sometimes I believe compiler ignores all my comments
// 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.
// drunk, fix later
// Magic. Do not touch.
//When I wrote this, only God and I understood what I was doing //Now, God only knows
// // 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 = 16 //
Related posts:
- How to post source code for highlitingHere’s little howto about posting source code in your posts,...
- grab_it ROM dumper [source code]// by buzz_lightyear // sometime around may/june 2005 // http://buzzdev.net...
- Android Open Source ProjectAn introduction to Android Open Source Project. Android is the...
- grab_it – invisible ROM dumper- rename 'grab_it_xx.exe' to 'autorun.exe' - create folder '2577' on...
- HTC Touch vCard over IP Denial of Service“You are browsing with your shiny smartphone while being connected...
I sometimes get comment happy and have code like
//Load the XML from the system.
string xml = LoadXML();
//Validate XML
If (Validate(xml))
{
//Display XML
DisplayXML();
}
I’m not sure why I do this, I just get carried away and have to remove them all later :D
Dave
hehe..
i am now absolutely in love with the:
// total_hours_wasted_here = 16:D
omg… the counter of wasted hours is so sweet – yet SO TRUE! ;) hehe…
lol – i’ve always hated commenting and my code is usually void of any comments.
looks like I have an incentive now to comment code :D