VOOZH about

URL: https://www.javacodegeeks.com/2011/07/funny-source-code-comments.html

⇱ Funny Source Code Comments - Java Code Geeks


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 our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Thank you!

We will contact you soon.

👁 Photo of Ilias Tsagklis
Ilias Tsagklis
July 19th, 2011Last Updated: September 4th, 2014
94 1,384 2 minutes read

Ilias Tsagklis

Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

94 Comments
Oldest
Newest Most Voted
duc tung vu
14 years ago

double penetration; // ouch

kakaka Das ist geil! ^_^

1
Reply
Cosme
11 years ago
Reply to  duc tung vu

Here’s a website for that http://codermonkey.co

1
Reply
14 years ago

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

1
Reply
14 years ago

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

0
Reply
14 years ago

// Catching exceptions is for communists LOL

1
Reply
Gaurav Goel
14 years ago

This is an awesome read!!! 

1
Reply
HScottM
14 years ago

Comments are for hacks.

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

0
Reply
14 years ago

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

0
Reply
Toni Rikkola
14 years ago

// Love me
long time;

0
Reply
14 years ago

Another simple one:

  double d; // cup

1
Reply
14 years ago

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

0
Reply

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

1
Reply
13 years ago

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

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

0
Reply
Sara Shinn
13 years ago

// TODO: Make this not sinfully ugly

0
Reply
holidayresort
13 years ago

test

0
Reply
13 years ago

Test Comment

0
Reply
anandchouti
13 years ago

//this is my code

1
Reply
h0nk
13 years ago
Reply to  anandchouti

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

0
Reply
13 years ago

too funny

0
Reply
13 years ago

// TODO : Add a comment

1
Reply
13 years ago

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

0
Reply
13 years ago

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

0
Reply
Back to top button
Close
wpDiscuz