Blog

A necessary evil: Code comments

Code comments

The can be REALLY helpful or REALLY confusing. They come in all shapes and forms. In my opinion, they are the best!

I’ve compiled a list of code-comments which are worth been mentioned. Authors are unknown and, even if they are known, I wouldn’t mention the names…don’t want to get anyone in trouble :) . Hope you enjoy and have some fun! If you have some you want to share, please feel free to add ‘em on the comment area!

 

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

// When I wrote this, only God and I understood what I was doing
// Now, God only knows

// sometimes I believe compiler ignores all my comments

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

long long ago; /* in a galaxy far far away */

/**
 * Always returns true.
 */
public boolean isAvailable() {
    return false;
}


// if you do not like UGLY MONSTERHACKS,
// skip reading the next three lines

// A function that retrieves all females from the database
// for processing and display:
function getGirls() { //if only it were really that simple
[...]
}

# all this f*cking around with unicode and the document
# header is to get lxml to STFU. Yeah, this is probably
# The Wrong Way(TM), once again, but that’s how I roll,
# y0: ghetto-tastic shitball code. If you want
# to understand why each of these changes was made, remove
# this jiggery pokery and you’ll see what I mean. ;-P

// I have absolutely no idea, why it becomes a
// 2-dimensional array … so working around instead
// of solving
$css = $css[0];

# FIXME: and this is just plain /wrong/. Naughty naughty
# this is why I have to learn some kind of signal creation
# techinque. OOOOH OH OH OH , ORRRRRR, I can just pass
# in a single callback…? pull in one particular method
# from the caller for the called object to refer back to
# as a conduit back into that caller. Is that crack?
# ….orrrrrrrrrr….. the data manager is the one that
# knows this shit and can take care of the “your shit
# changed, so update it motherf*cker” kinds of tasks.
#
# Longest. Comments. Evar.

/**
 * The below code may answer the question: “Should I try
 * to write programs while watching a James Bond movie?”
 */

// Real programmers don’t comment their code – it was hard to write, it should be hard to understand.

/*
Ok. I confess. I did write this piece of shit. But I’ll
deny any knowledge of it if you ever tell anyone. –AV
Oh, you think this is bad? And the crap above is better ?
I won’t tell if you won’t. –DJ
*/

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

// You are not expected to understand this

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

// abandon all hope who enter beyond this point

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

// Houston, we have a problem

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

Leave a Comment

Your email address will not be published. Required fields are marked *

     

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>