Skip to main content

funniest source code comments

from stackoverflow.com


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

// 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.
// Autogenerated, do not edit. All changes will be undone.
// drunk, fix later
// Magic. Do not touch.
/*
 * 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.
 */
try {
} finally { // should never happen
}
const int TEN=10; // As if the value of 10 will fluctuate...
//This code sucks, you know it and I know it. 
//Move on and call me an idiot later.
// If this comment is removed the program will blow up
// I don't know why I need this, but it stops the people being upside-down

x
= -x;
   #Christmas tree initializer  
    toConnect
= []  
    toRead
=   [  ]  
    toWrite
= [    ]  
    primes
= [      ]  
    responses
= {}  
    remaining
= {}
/* Please work */
// I am not sure if we need this, but too scared to delete.
//Dear future me. Please forgive me. 
//I can't even begin to express how sorry I am.
// I am not responsible of this code.
// They made me write it, against my will.
/* Halley's comment */

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

/* IF DOLPHINS ARE SO SMART, HOW COME THEY LIVE IN IGLOOS? */

// I have to find a better job

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

// hack for ie browser (assuming that ie is a browser)

// TODO: Fix this.  Fix what?

  ## Safety pig has arrived!
  text
= h(text)
 
##                               _
 
##  _._ _..._ .-',     _.._(`))
 
## '-. `     '  /-._.-'    ',/
 
##    )         \            '.
 
##   / _    _    |             \
 
##  |  a    a    /              |
 
##  \   .-.                     ;  
 
##   '-('' ).-'       ,'       ;
 
##      '-;           |      .'
 
##         \           \    /
 
##         | 7  .__  _.-\   \
 
##         | |  |  ``/  /`  /
 
##        /,_|  |   /,_/   /
 
##           /,_/      '`-'
 
##

// Catching exceptions is for communists

public boolean isDirty() {
   
//Why do you always go out and
   
return dirty;
}

// If you're reading this, that means you have been put in charge of my previous project.
// I am so, so sorry for you. God speed.

long time; /* know C */

/* Be a real daemon: fork myself and kill my parent */

//
//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!
//

// The ratio of a circle's circumference to its diameter.  Remember to change
// this to 3.0 if you move to a site in Indiana.
#define Pi  

try {
}
catch (SQLException ex) {
   
// Basically, without saying too much, you're screwed. Royally and totally.
}
catch(Exception ex)
{
   
//If you thought you were screwed before, boy have I news for you!!!
}

/*
after hours of consulting the tome of google
i have discovered that by the will of unknown forces
without the below line, IE7 believes that 6px = 12px
*/

font
-size: 0px;

using namespace std;            // So sue me

Great one from leaked Windows 2000 source code :
!!!!!!!IF YOU CHANGE TABS TO SPACES, YOU WILL BE KILLED!!!!!!! *
!!!!!!!!!!!!!!DOING SO FUCKS THE BUILD PROCESS!!!!!!!!!!!!!!!! *
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

In a homework assignment in college for a teacher who was particularly adamant that we comment our code:
//I wonder if she actually reads these.
When the assignment was returned, in red pen next to that comment "Yes, I do"

// if i ever see this again i'm going to start bringing guns to work

/* You are not expected to understand this */

 /*** If you don't understand this code, you should be flipping burgers instead.*/
// If this code works, it was written by Paul DiLascia. If not, I don't know who wrote it
//Mr. Compiler, please do not read this
// and there is where the dragon lives
/*

** The author disclaims copyright to this source code.  In place of            
** a legal notice, here is a blessing:                                          
**                                                                              
**    May you do good and not evil.                                            
**    May you find forgiveness for yourself and forgive others.                
**    May you share freely, never taking more than you give.

*/
catch (Ex as Exception)
{
     
// oh crap, we should do something.
}
//If you're reading this, then my program is probably a success
/***************************************************************************/
/* deep wizardry. do not touch. */
/* */
/* no seriously. XXXXXX I'm looking at you. If you screw with this again */
/* I will kill you with my swingline stapler. */
/* */
/* ... */
/* NOT FIT FOR HUMAN CONSUMPTION */
//open lid

//take sh!t

//close lid
// This is crap code but it's 3 a.m. and I need to get this working.
// For the sins I am about to commit, may James Gosling forgive me
/* Sun, you just can't beat me, you just can't.  Stop trying,
* give up.  I'm serious, I am going to kick the living shit
* out of you, game over, lights out.
*/
// If I from the future read this I'll back in time and kill myself.
// This code was written by a genius so don't try to understand it with
// your tiny little brain
return 0; // Happy ending
//this formula is right, work out the math yourself if you don't believe me
// 
// 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 = 35
//

Comments

Popular posts from this blog

Capture and compare stdout in python unit tests

A recent fan of TDD, I set out to write tests for whatever comes my way. And there was one feature where the code would print messages to the console. Now - I had tests written for the API but I could not get my head around ways to capture these messages in my unittests. After some searching and some stroke of genius, here's how I accomplished capturing stdout.

On working remote

The last company I worked for, did have an office space, but the code was all on Github, infra on AWS, we tracked issues over Asana and more or less each person had at least one project they could call "their own" (I had a bunch of them ;-)). This worked pretty well. And it gave me a feeling that working remote would not be very different from this. So when we started working on our own startup, we started with working from our homes. It looked great at first. I could now spend more time with Mom and could work at leisure. However, it is not as good as it looks like. At times it just feels you are busy without business, that you had been working, yet didn't achieve much. If you are evaluating working from home and are not sure of how to start, or you already do (then please review and add your views in comments) and feel like you were better off in the office, do read on. Remote work is great. But a physical office is better. So if you can, find yourself a co-working s

I was fat once! Now I run!

On Aug 12, 2013 I weighed 107 kg, which, for a 5'4'' guy, is 47 kg more than the Indian Army standards. But today, I weigh 82 kg, and I continue to lose a few pounds every week! At one point of time, running 100 metres would make me all tired and sweaty, but today I can easily run 10 km at a stretch! So this guide is for all those couch potatoes who have lost all hopes of getting a good body! I was at that stage myself. I know how it feels like. I know the bullshit that you keep telling yourself as to how you are not all that bad, and how the world should accept you the way you are! Let me tell you this straight! You are NOT special. You are just another lazy bum who wants things to change but does not want to endure any suffering! Or even worse, you are one of those who act on an impulse every few months. You hit the gym for a week and boom!, you lose it all again. The first step is to accept that you have a pathetic body and that this needs to change! Start Sm