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

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.


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


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

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. Alan Wynn says:

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

    And I tweeted about it a long time ago haha –>

  2. Coder says:

    anyone noticed …
    double penetration; // ouch

  3. jroper says:

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


  4. Dino Wuff says:

    ‘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

  5. Guest says:

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

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

    } else {
    // user chose no

  7. Gimmle says:

    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

  8. etienne says:

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

  9. Sarang says:

    just awesome :D :D :D

  10. Timothy Elliott says:

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

  11. adnan abdollah zaki says:

    it’s really true . hahaha

  12. Natanael Fonseca says:

    Great Article, Lol !

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

  14. mooj84 says:

    try {

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

    one of best comments ever seen

  15. Guest says:

    I think your busyforlunch condition is vice-versa

  16. Hasan says:


  17. Well, not a comment, but this is in an objc project of mine:

    #warning this is so dirty I had to put porn on when my mom walked in

  18. Reihane Zekri says:

    Very funny! but from original post I liked this one:
    * 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.

  19. Avrom says:

    After commenting on some code in our code base, my co-worker wrote the following comments:

    // according to Avrom all this should be taken out to pasture and shot.
    // nah, it’s usable.
    // nah, it’s not.

Leave a Reply

× five = 45

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: