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

The economics of crypto investing

If you believe in the greater fool theory, there is no other market as speculative and volatile as the crypto market today. We are perhaps living in the biggest bubble of our times. I am not bullish on this market in particular. I am bullish on the mania. 90% of the cryptos we see today will crash. They are just tokens with no tangible value generation capability. However, I believe that the mania and euphoria will stay.

Having said that, should one consider investing in this market? Certainly!
The risk/reward is lovely, potential upsides and margins are huge and with 3-5% of your net worth, the bet on the mania is worth it.

How does one choose where to invest?

If you follow the stock markets, you are expected to do thorough Fundamental Analysis before investing. Expect the same for the crypto market. I invest in large caps. I invest in index funds. And I invest over and over again. Markets rise, always. Extrapolating the same strategy - invest in indices - the top 10 tokens by perfo…

Learn frontend to get good at backend : lessons for my 20 year old self

Only when you are the consumers of your own products, can you design the best ones! Same philosophies go for API design and programming in general.

This advice may seem counter-intuitive at first, but trust me, the best way to get better at backend programming is to spend some time doing frontend! It will teach you a lot about how your APIs are being used in the "real world". A first-hand experience of API consumption will tell you a lot about your design philosophies!

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.