Ilias Tsagklis

About Ilias Tsagklis

Ilias Tsagklis is a senior software engineer working in the telecom domain. He is an applications developer in a wide variety of applications/services. Ilias is co-founder and Executive Editor at Java Code Geeks.

Funny Source Code Comments

I recently stumbled upon an awesome Stack Overflow thread, entitled “What is the best comment in source code you have ever encountered?”.

As you might have guessed, it is a collection of funny source code comments, provided by developers all over the world. Take a look at it, it could definitely make your day.

I am reposting here my personal favorites from that long long collection:

// sometimes I believe compiler ignores all my comments

Exception up = new Exception(“Something is really wrong.”);
throw up; //ha ha

//When I wrote this, only God and I understood what I was doing
//Now, God only knows
Tweet: When I wrote this, only God and I understood what I was doing. Now, God only knows. http://ctt.ec/79B28+

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

return 1; # returns 1

double penetration; // ouch

/////////////////////////////////////// this is a well commented line

// I am not sure if we need this, but too scared to delete.

// I am not responsible of this code.
// They made me write it, against my will.
Tweet: I am not responsible for this #code. They made me write it, against my will. http://ctt.ec/94mkz+

//Dear future me. Please forgive me.
//I can’t even begin to express how sorry I am.

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

// I have to find a better job

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

} catch (PartInitException pie) {
// Mmm… pie
}

// John! If you’ll svn remove this once more,
// I’ll shut you, for God’s sake!
// That piece of code is not “something strange”!
// That is THE AUTH VALIDATION.

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

// Catching exceptions is for communists

// 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.
Tweet: If you’re reading this, you have been put in charge of my previous project. I am so, so sorry for you. God speed.. http://ctt.ec/ceBra+

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

// The magnitude of this hack compares favorably with that of the national debt.
Tweet: The magnitude of this hack compares favorably with that of the national debt. http://ctt.ec/bHara+

//ALL YOUR BASE ARE BELONG TO US

// If this code works, it was written by Paul. If not, I don’t know who wrote it

//You are not expected to understand this

/**
* If you don’t understand this code, you should be flipping burgers instead.
*/

‘NO COMMENT

//Abandon all hope yea who enter beyond this point

//Mr. Compiler, please do not read this.

catch (Ex as Exception)
{
// oh crap, we should do something.
}

// TODO make this work

// If you delete the credits, I will fucking kill you.

// This is crap code but it’s 3 a.m. and I need to get this working.
Tweet: This is crap code but it’s 3 a.m. and I need to get this working. http://ctt.ec/GHF_s+

// For the sins I am about to commit, may James Gosling forgive me
Tweet: For the sins I am about to commit, may James Gosling forgive me http://ctt.ec/97IK9+

// Houston, we have a problem

// If I from the future read this I’ll back in time and kill myself.

Pure awesomeness… Don’t forget to share your own favorites in the comments!

Related Articles :

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

68 Responses to "Funny Source Code Comments"

  1. Nice post!! had a good time reading this. thanks for sharing….

  2. Krishna says:

    I’m never laughed over a computer related stuff like i did a minute by reading all the source code comments… Just too good!!!

  3. Luke says:

    Just came across this double comment while going through some painfully horrendous legacy code:

    ‘=======================================================================================================================================
    ‘ We have events, so things get good here! <- what do you mean things get "good" here? Nothing is remotely good in this page ever!
    '=======================================================================================================================================

  4. Young says:

    That’s funny.HAHA

  5. Stuart says:

    /*We don’t care about performance, only accuracy because
    * we know IT can just throw a few more servers up up their asses.
    * We also don’t care if you can’t comprehend this, because you are
    * probably an offshore developer with poor English. */

    • Alex says:

      Hey Stuart,

      I assume that’s a SQL Code comment block, right? I dislike SQL programmers that don’t optimize their code, they are just bad programmers… I wanted to get that off my chest.

  6. Robert says:

    A friend of mine worked in the Houston office of Amoco (a large oil company), which later merged with PB. The following comments appeared next to an unknown error code…

    // Shut her down, Clancy. She’s pumping mud.

  7. Neil Modi says:

    \\ Awesomest post ever i Read
    \\ i have read this all lots time but never thought such type of blog post
    \\ incredibly collected.

  8. David says:

    One I recently came across:

    // Initiate the matrix – not quite as sinister as it sounds

  9. bomco3 says:

    Toto, I’ve a feeling we’re not in Kansas any more

  10. Arun prasad says:

    ################Good One############ Few More below…!

    // If this comment is removed the program will blow up

    try {

    } finally { // should never happen

    }

    Catch (Exception e) {
    //who cares?
    }

  11. Nicki says:

    – There is a bug here that I did not have the time to fix right now

  12. Dev says:

    LOLz :) … This reminds me of similar funny comments we used to add in the log files.

  13. Ranjith says:

    I use to put these…
    //Enter the new Dragon !!

  14. maelorin says:

    #DO NOT SHIP WITH THIS COMMENT INTACT!!

    #Fix what follows, I beg of you…

    //This does nothing useful, but the rest of this code fails to compile without it
    {
    return;
    }
    //Don’t bother wasting time figuring out why.

    /*
    * What is this code supposed to even do?
    */

    ##
    ## NO ONE WILL NOTICE, THEY SAID …
    ## WHAT’S THE WORST THAT CAN HAPPEN, THEY SAID …
    ## RUN THIS AND SEE FOR YOURSELF, I SAID.
    ## AND, LO, YOU DID
    ##

    // insert comment here
    function f(x,e);
    {
    printf “insert function to do stuff here”;
    }

    ** Boss man be mad when he read this code

    ** Only joking. Boss man never read code

  15. Mik says:

    Haha, i had to put a few aside :D you never know when you’ll need to use them.
    Also, here are a few more :

    #define TRUE FALSE //Happy debugging suckers

    and a favorite of mine :

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

  16. This reminds me: One time when I was trying to locate a source of performance issues, I finally found the right method, which contained:

    // TODO Can cause performance problems, fix in the future

  17. DarC says:

    my favourites

    // – FFS what now it was working till you touched it

    popped up in many a log file for some reason

    // – leave me alone I might not be the prettiest but at least I work (unlike some)

  18. David P says:

    In the late 70’s I was told a story by a Control Data mainframe software engineer, I’m not sure it’s true, but it goes like this:

    One night two operating system engineers were sitting working on a set up updates to the next OS release. The junior of the two finds himself in a branch of code but is unsure what to do if it ever got executed. So he floats over to the senior guy and explains the situation. After thinking for a bit the senior guy says “That will never happen because…” and reels off a set of reasons demonstrating that he clearly understands WAY more than the junior guy. Mollified, but still unsure, the junior guy goes back to work.

    Within a month of the release going live, a mainframe experiences a critical stop. The message on the operator’s console read:

    “This can’t have happened, but it did, so tell Fred he owes me $50″

  19. sunny says:

    ROFL!! Totally awesome… great collectioin.

Leave a Reply


− 5 = four



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close