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

How the Python import system works

How the Python import system works From:  https://tenthousandmeters.com/blog/python-behind-the-scenes-11-how-the-python-import-system-works/ If you ask me to name the most misunderstood aspect of Python, I will answer without a second thought: the Python import system. Just remember how many times you used relative imports and got something like  ImportError: attempted relative import with no known parent package ; or tried to figure out how to structure a project so that all the imports work correctly; or hacked  sys.path  when you couldn't find a better solution. Every Python programmer experienced something like this, and popular StackOverflow questions, such us  Importing files from different folder  (1822 votes),  Relative imports in Python 3  (1064 votes) and  Relative imports for the billionth time  (993 votes), are a good indicator of that. The Python import system doesn't just seem complicated – it is complicated. So even though the  documentation  is really good, it d

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

Todo lists are overrated

My tasks come from a variety of sources: 1) Tasks from emails  2) Meeting notes with details of people who participated  3) Project related tasks that can have a long format and can be tagged/ delegated  4) Scratchpad for unrefined ideas  5) Detailed documentation for completed technical tasks / ideas  6) FIFO list of high priority small daily tasks No one app has been able to map all the requirements above, and I have tried a lot of them! In my lifetime I’ve tried a dozen todo apps. In the beginning they all seem different, novel and special. Slick UI, shortcuts, tags, subtasks, the list goes on and on. But all our stories were the same: I start using the new app, then after awhile I stop using it. Up until the last week I thought the problem was in myself (you probably think so too). After all, David Allen seems to have figured this shit out. Also there are people leaving long 5 star reviews on every major todo list app, they discuss them on forums, recommend them to friends. But the