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

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

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

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

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

// For the sins I am about to commit, may James Gosling forgive me

// 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 :
Share and enjoy!
Post to Facebook Post to TwitterPost to Google+Post to Delicious Post to StumbleUponAdd to LinkedInAdd to DiggAdd to RedditSend via Mail
  • duc tung vu

    double penetration; // ouch

    kakaka Das ist geil! ^_^

  • http://twitter.com/Nico3333fr Nicolas Hoffmann

    width:300px;
    /* 300 ? This is SPARTAAAAAAAAAAAAA ! */

  • http://www.facebook.com/profile.php?id=608908344 Rishi Yagnik

    One of the comments I had it was as follows : 

    //why am I writing this piece of crap,It can make other’s life miserable..

  • http://twitter.com/Janx_Spirit Nico

    // Catching exceptions is for communists LOL

  • Gaurav Goel

    This is an awesome read!!! 

  • HScottM

    Comments are for hacks.

     If you need a comment, you’re doing it wrong.

  • http://profile.yahoo.com/AJL523NF7YLZQ6KI53ZIGYTTDY Abhishek

    I have a few tame ones: 

    Advisory :
    *Code too complicated – Just read the comments In module description :
    *It also shoots off rockets to Mars and Jupiterand in the clean up para :*Music is over turn off the lights..  

  • Toni Rikkola

    // Love me
    long time;

  • http://twitter.com/cowtowncoder Tatu Saloranta

    Another simple one:

      double d; // cup

  • http://www.facebook.com/profile.php?id=100000815359898 Keegan Dahm

    A comment from my own shot at obfuscated programming (added to take up space and let me format the whole program into a nice little square).

    float gorF = main(args);//gorF is Frog backwards

  • http://www.facebook.com/profile.php?id=1653900175 Kim Alvin Pengson Lambiguit

    //i don’t know why but this seems to work.

  • http://www.facebook.com/people/Alon-Bar-David/813362158 Alon Bar David

    //Temporary hack for client. Remove on Monday.
    (Written 2002, found 2010)

    //This code does WHAT? … it doesn’t work…

  • Sara Shinn

    // TODO: Make this not sinfully ugly

  • holidayresort

    test

  • http://www.facebook.com/prasert.mansri Prasert Mansri

    Test Comment

  • anandchouti

    //this is my code

    • h0nk

      // There is much code like this
      // But this one is mine

  • http://wadub.com/ baltazar

    too funny

  • http://www.facebook.com/marc.terrasson.1 Marc Terrasson

    // TODO : Add a comment

  • http://www.facebook.com/Powlie Paul Rose

    I used to work with someone who would always comment line 42 with ‘The answer to life the universe and everything’. Everything.

  • http://www.demogar.com demogar

    /**
    * just leave it as it is. if you don’t understand what this code does, then: u can’t touch this
    * http://www.youtube.com/watch?v=otCpCn0l4Wo
    */

  • http://twitter.com/djekl Alan Wynn

    This is a one I found in some Microsoft Javascript on their site;

    // this is a fucking tragedy…it assumes that the genre filter is there too, since that’s valid for the only
    // case this is used in I’m leaving it like this, but it’s shit and should be fixed. just not now, or probably by me

    Find it here –> http://xbox.iconmobile.com/js/xbox3/main.js

    And I tweeted about it a long time ago haha –> https://twitter.com/djekl/status/159693087038373890?iid=am-45140289413269087931515100&nid=6+status_timestamp&uid=46642288

  • Coder

    anyone noticed …
    double penetration; // ouch

    • Ilias Tsagklis

      lol yeah ;-)

  • jroper

    Not a comment, but this comes from the source code for JIRA:

    ariseSirJiraAndUpgradeThyself();

  • Dino Wuff

    ‘Ok. There are two important things to remember when looking at this code.
    ‘Dino was here so a lot of the comments are for my benefit (testing stuff). And if something looks strange
    ‘it’s because I have no formal training in any “programming” discipline what so ever
    ‘so if you are trying to fix something here – sorry about your bad luck

  • Guest

    Girl girl = new Girl();
    Guy guy = new Guy();
    guy.IntroduceTo(girl);
    guy.StoreGirlPhoneNumber(girl.PhoneNumber); //crazy
    /*not sure, maybe*/
    //try {
    // guy.Call(girl)
    //}
    //catch (Excepcion e) {
    // throw e;
    //}

    • 3Nex

      Not sure maybe should rather be in a condition that compares a result of rand() or something

  • http://identi.ca/erez Erez Schatz

    if (event.detail==Alert.YES) {

    } else {
    // user chose no
    }

  • Gimmle

    my favorite from one of my previous work places was a code made in an inner company language, the used a language called cache’ (don’t ask! really you don’t want to know, and if you do know, I feel for you).
    the code was (translated to english) : New A Set A

    N A S A //we have a problem
    never got tired of seeing this one

  • etienne

    /* frame allocator */
    struct frame *falloc (struct page *);

  • Sarang

    just awesome :D :D :D

  • Timothy Elliott

    Dude that’s freakin awesome!!! :) Congrats!!! :D

  • adnan abdollah zaki

    it’s really true . hahaha

  • Natanael Fonseca

    Great Article, Lol !

  • http://www.facebook.com/profile.php?id=100002698603879 Susan Henderson

    Found in an Old COBOL program in the 80′s “Is it true that Frito Lays?”

  • mooj84

    try {

    } catch (Exception e) {
    //silent as a ninja
    }

    one of best comments ever seen

  • Guest

    I think your busyforlunch condition is vice-versa

  • http://www.facebook.com/ravi.choudhari.735 Ravi Choudhari
  • Hasan

    just…..awesome!!!



© 2010-2012 Java Code Geeks. Licenced under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
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.