How to NOT comment your code

How to NOT comment your code

Researching for the yesterday's post ("Look, I am playing tennis" or how to document your code), I stumbled on a interesting topic, and that is "funny comments".

While initially the post advised against it, I found some that are really funny so I would like to list some of them here. While they are not useful, they do increase the quality of the code by making the other developers laugh.

But there is a danger that some might not get our humour so when in doubt, better don't add it.


/**
* For the brave souls who get this far: You are the chosen ones,
* the valiant knights of programming who toil away, without rest,
* fixing our most awful code. To you, true saviors, kings of men,
* I say this: never gonna give you up, never gonna let you down,
* never gonna run around and desert you. Never gonna make you cry,
* never gonna say goodbye. Never gonna tell a lie and hurt you.
*/


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


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


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


// somedev1 -  6/7/02 Adding temporary tracking of Login screen
// somedev2 -  5/22/07 Temporary my ass


// drunk, fix later


// Magic. Do not touch.


#define TRUE FALSE //Happy debugging suckers


Catch (Exception e) {
 //who cares?



/*
 * You may think you know what the following code does.
 * But you don't. Trust me.
 * Fiddle with it, and you'll spend many a sleepless
 * night cursing the moment you thought you'd be clever
 * enough to "optimize" the code below.
 * Now close this file and go play with something else.
 */ 


//This code sucks, you know it and I know it.  
//Move on and call me an idiot later.


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


// I have to find a better job


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


// 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 this code works, it was written by Paul. If not, I don’t know who wrote it


//You are not expected to understand this


// This is crap code but it’s 3 a.m. and I need to get this working.


// Abandon all hope, ye who enter here.


 From: here and here

read more on http://blog.adelante.ca

I've used // Magic. Do not touch. HA!

Like
Reply
Stefan Rusen

Learn. Un-learn. Re-learn. Grow. Skeptical Optimist

10y

My favorite "//sometimes I believe compiler ignores all my comments"

Like
Reply

To view or add a comment, sign in

More articles by Dragos Ionel

  • AIGeeks 2019 in review, plans for 2020

    As we’re wrapping 2019 up, we have high hopes for how AI will improve our lives in 2020. This year, we organized and…

    2 Comments
  • How can AIGeeks help you?

    As you know AIGeeks is a Non Profit trying to improve our world around us using AI. Other than organizing the meetup…

  • Be cautious with the ternary operator

    The operators in a programming language, in general, and in Swift, in particular, are of three types: Unary - that…

    2 Comments
  • Use long names when writting your code

    Unfortunately, we have been used to the fact that a name has nothing to do with the object it names. John, Mary, and…

  • Write tests

    Welcome to another post about how to improve our code. Today we are trying to prove that the quality of the code…

    4 Comments
  • How to name a function - Coding in Style - episode 11

    Welcome to Coding in style, a series of short videos about how to improve our code. This is Dragos and you are watching…

  • Reducing the cyclomatic complexity - Coding in style - Episode 9

    Welcome to Coding in style, a series of short videos about how to improve our coding. This is Dragos and you are…

  • To comment or not to comment

    Welcome to Coding in Style, a series of short videos about how we can improve our code. This is the episode 6 where we…

    2 Comments
  • Coding in style in 60 seconds - Comments

    Welcome to Coding in Style in 60 seconds. This is Dragos and you are watching a series of short videos about how we can…

  • Get smart by being stupid

    Do you know why programming is the best job ever? From the thousands and thousands of possible jobs out there…

Others also viewed

Explore content categories