32+ funny Code Comments that people actually wrote - JavaScript in Plain English - Medium

 
notion imagenotion image
Code Commenting! Some people say its ugly , Some says its standard and good practice to do.
Commenting is the “art” of describing what your program is going to do in “high level” English statements.
Well, This writing will show you how code commenting can be funny too. I have listed some funny code comments people encountered in production code.
TL;DR Noting serious here ! Read this just for fun !
i++; //increment i
// 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.
// I am not responsible of this code.// They made me write it, against my will.
// // 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
//Dear future me. Please forgive me. //I can't even begin to express how sorry I am.
//open lid//take sh!t//close lid
/** TODO: Remove this functionfunction remove($customer_id) { $this->Customer->remove($id); }*/
#Christmas tree initializer toConnect = [] toRead = [ ] toWrite = [ ] primes = [ ] responses = {} remaining = {}
// somedev1 - 6/7/02 Adding temporary tracking of Login screen// somedev2 - 5/22/07 Temporary my ass
// IE7 update. this is still bad code, but IE8 is probably a long way off :)
// no comments for you// it was hard to write// so it should be hard to read
// If this code works, it was written by Paul DiLascia. If not, I don't know// who wrote it
//This code sucks, you know it and I know it. //Move on and call me an idiot later.
/** * Always returns true. */public boolean isAvailable() { return false;}
/////////////////////////////////////// this is a well commented line
Exception up = new Exception("Something is really wrong.");throw up; //ha ha
// somedev1 - 6/7/02 Adding temporary tracking of Login screen// somedev2 - 5/22/07 Temporary my ass
/*** 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 saviors, 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.*/
int MyFunction(){ // There once was a man named Dave int Result = 0; // Whose code just wouldn't behave MyObject *Ptr = new MyObject(); // He left to go to a meetin' Result = Ptr->DoSomething(); // And left his memory a leakin' return Result;}
////3.4 JeK My manager promised me a lap dance if I can fix this release//3.5 JeK Still waiting for that dance from my manager//3.6 JeK My manager got changed, the new manager is hairy, dont want the dance anymore//3.7 Jek Got that dance, yuck!//
public boolean isDirty() { //Why do you always go out and return dirty;}
/*after hours of consulting the tome of googlei have discovered that by the will of unknown forceswithout the below line, IE7 believes that 6px = 12px*/font-size: 0px;
public GetRandomNumber(){ // Chosen by a fairly rolen dice return 12;}
def format_ticket_content(text, recursive = true) if text.is_a?(TicketNote) note = text text = note.content else note = nil end ## Safety pig has arrived! text = h(text) ## _ ## _._ _..._ .-', _.._(`)) ## '-. ` ' /-._.-' ',/ ## ) \ '. ## / _ _ | \ ## | a a / | ## \ .-. ; ## '-('' ).-' ,' ; ## '-; | .' ## \ \ / ## | 7 .__ _.-\ \ ## | | | ``/ /` / ## /,_| | /,_/ / ## /,_/ '`-' ##
/* * You may think you know what the following code does. * But you dont. Trust me. * Fiddle with it, and youll spend many a sleepless * night cursing the moment you thought youd be clever * enough to "optimize" the code below. * Now close this file and go play with something else. */
// Replaces with spaces the braces in cases where braces in places //cause stasis $str = str_replace(array("\{","\}")," ",$str);