Colorful code

Ron Northcutt Verified user

Head of DevRel

Appsmith

52 Funny Code Comments

Some funny humor for a Friday. I'm writing some code to parse comments, a tutorial on how to write the code, and another blog post on why. I've come across a few funny code comments worth sharing, so here you go:

A list of 52 funny code comments and my immediate reaction

  1. Yo dawg, I heard you liked recursion...

    # To understand recursion, see the bottom of this file. 
     ... 
     ...
     ...
    # To understand recursion, see the top of this file.
  2. Some secrets are lost to the beyond

    // When I wrote this, only God and I understood what I was doing. 
    // Now, God only knows.
  3. Self care

    // Dear future me. Please forgive me. 
    // I can't even begin to express how sorry I am. 
  4. Kilroy was here

    // 
    // 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
    // 
  5. Chaotic evil

    #define TRUE FALSE //Happy debugging suckers
  6. Seems fair

    // chosen by fair dice roll. 
    // guaranteed to be random.
    int getRandomNumber() { Return 4;  }
  7. Must have impressive pants

    stop(); // Hammertime!
  8. Do we have an Andrew?

    // Hardcoded this for time sake ... will make andrew fix later :)
  9. Good, now I can relax

    /* You are not meant to understand this */
  10. Hacks that stand the test of time

    // somedev1 -  6/7/02 Adding temporary tracking of Login screen
    // somedev2 -  5/22/07 Temporary my ass
  11. Does Darlene know

    // 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.
  12. Do not cross this dev

    # This is because you messed with me the other day 
    if current_admin.name == "#{my_x_employer}" sleep(1000 * 3600) end
  13. Almost a haiku - so close

    // no comments for you 
    // it was hard to write 
    // so it should be hard to read
  14. Needs a more impressive sign

    // Magic. Do not touch.
  15. Fair enough

    // This code sucks, you know it and I know it. 
    // Move on and call me an idiot later.
  16. Realizations on a Saturday night

    // I have to find a better job
  17. Over documented

    return 1; # returns 1
  18. Warning from the ancients

    /*
    * 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. Girl, same...

    // This is crap code but it's 3 a.m. and I need to get this working.
  20. Open source FTW

    // I don't understand how the following bit works, 
    // but it worked in the program I stole it from.
  21. Worth a Pulitzer

    // Replaces with spaces the braces in cases 
    //      where braces in places cause stasis 
    $str = str_replace(array("\{","\}")," ",$str);
  22. I'm just an engineer, what do I know

    // I am not responsible for this code. 
    // They made me write it, against my will.
  23. Trippy

    last = first /* Biblical reference */
  24. Fancy warning

    // Caveat implementor
  25. I don't either, but for goodness sake let's keep them right side up

    // I don't know why I need this, but it stops the people being upside-down
    x = -x;
  26. Stick it in the back of the closet

    // I am not sure if we need this, but too scared to delete. 
  27. Somebody told me that his name was Bill

    doRun.run();  // ... "a doo run run".
  28. No lo toques

    //**************************************
    // Dear code maintainer:
    //
    // This source contains COM interfaces, not to be confused with interfaces 
    // of any other sort, please do not just willy-nilly add additional methods 
    // to these interfaces as they are truely immutable, unlike the interfaces 
    // that other software vendors like Microsoft maintain.  IF you need to add 
    // new functionality, then go thru the trouble of creating a NEW interface 
    // and implement this functionality on only the objects you need.  
    //
    // While the money is good for fixing all of the problems caused by not 
    // following the rules, I would rather work on things which actually have
    // an impact on the future of the product rather than curse and yell 
    // obsenities at the screen because someone didn't bother to understand the
    // true meaning of IMMUTABLE.  
    //**************************************
  29. Versus

    /* I did this the other way */
  30. Think on your feet

    // uncomment the following line if the program manager 
    //     changes her mind again this week
  31. Yes, please

    /* Please work */
  32. Scott needs some aloe for that sick burn

    // This only exists because Scott doesn't know how to use const correctly
  33. RIP IE, glad you are gone

    /*
    after hours of consulting the tome of google
    i have discovered that by the will of unknown forces
    without the below line, IE7 believes that 6px = 12px
    */
    font-size: 0px;
  34. The math checks out

    // I can't divide it with zero, so I have to divide it 
    //    with something very similar 
    result = number/0.00000000000001
  35. Story of my life

    #TODO: Figure out what I’m doing here and comment accordingly.
  36. Freakin' Ron...

    /*
       This isn't the right way to deal with this, but today is my last day, 
       Ron  just spilled coffee on my desk, and I'm hungry, 
       so this will have to do...
       */
       return 12; // 12 is my lucky number
  37. I feel your pain

    // If you are reading this, that means you have been put in charge of 
    // my previous project. I am sorry, so sorry for you. Godspeed.
  38. Haha, what

    // If this code is still being used when it stops working, then 
    // you have my permission to shoot me. Oh, you won't be able 
    // to - I'll be dead...
  39. Well played, Paul... well played

    // If this code works, it was written by Paul DiLascia. 
    // If not, I don’t know who wrote it.
  40. Here lies an absence of code

    // Once upon a time, two 'array_map' calls were sitting there, 
    // but for some reasons, they triggered 'E_WARNING' 
    // time to time (because of PHP bug [55416] 
    // (https://bugs.php.net/bug.php?id=55416). 
    // Now, they are gone.
  41. No one does, except God

    /* Ah ah ah! You'll never understand why this one works. */
  42. Passing notes in class

    // Mr. Compiler, please do not read this.
  43. Resistance is futile

    // Autogenerated, do not edit. All changes will be undone.
  44. Filed under humor

    // sometimes I believe compiler ignores all my comments
  45. Buckle up, it's gonna be a bumpy ride

    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!!!
    }
  46. Disclaimer

    //This was clearly written under duress.
  47. If it ain't broke

    // I know the line below is wrong, but it came that way from our 
    // IP vendor, and the driver won't work if you "fix" it. I've had to 
    // revert this change 4 times now. Leave it alone,
    // or I will hunt you down and hurt you
    if (r = 0) {
    /* bunch of code here */
    }
    else
    {
    /* even more code here */
    }
  48. Mmm... pie

    } catch (PartInitException pie) {
    // Mmm... pie
  49. Totally not over-caffeinated

    options.BatchSize = 300; // Madness? THIS IS SPARTA!
  50. Freakin' Ron ...

    // This code worked before, but my cat decided to 
    //      take a trip across my keyboard...
  51. Let's get 'drunk you' to comment it

    // I wrote this while drunk, 
    // I don’t know what it does, but if you remove it the program breaks.
  52. A noble and fitting ending

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

Do you have any to add? Comment below and share 'em.

Rahul Barwal Verified user staff View rahulbarwal's profile
Sat, 11/11/2023 - 00:01

I whole heartedly agree with #13.
#36 @ron why did you have to torture him?😅

 

Ron Northcutt Verified user staff View ron's profile
Sat, 11/11/2023 - 11:40

In reply to by rahulbarwal

It wasn't me, I swear! It was the cat...