Skip to content

Top funny source code comments

by Vinícius Krolow on setembro 14th, 2010
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 * OK; before you read the following code know what I am trying to do.
 * I needed to get the list of child catagories from the root node so that
 * the root node didn't appear in the selection box. But for some stupid
 * fucking reason the stupid fucking DBA wont let me access the items using
 * indices and I instead have to use their stupid fucking Iterator
 * implementation. So there.
 */
$firstList = $this->getRootNode()->getChildren();
foreach ($firstList as $node)
{
    $nodes = $node->getChildren();
    break;                // wtf?
}

1
// if i ever see this again i'm going to start bringing guns to work

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

1
2
3
4
5
6
7
8
/**
* 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.
*/

1
2
3
4
5
6
7
8
9
10
// 
// 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 = 16
//

1
// TODO: Fix this. Fix what?

1
2
3
// no comments for you
// it was hard to write
// so it should be hard to read

1
// I will give you two of my seventy-two virgins if you can fix this.

1
options.BatchSize = 300; //Madness? THIS IS SPARTA!

1
2
// I am not responsible of this code.
// They made me write it, against my will.

1
2
//Dear future me. Please forgive me.
//I can't even begin to express how sorry I am.

1
double penetration; // ouch

1
# To understand recursion, see the bottom of this file.

At the bottom file:

1
# To understand recursion, see the top of this file.

1
//I am not sure why this works but it fixes the problem.

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

1
2
3
4
5
6
7
/*
 * You may think you know what the following code does.
 * But you dont. Trust me
 * Fiddle with me, and youll spend many a sleppless
 * night cursing the moment you thought you be clever 
 * enough to "optimize" the code below.
 * Now close this file and go play with something else.

1
// drunk, fix later

1
// Magic. Do not touch.

1
2
3
// 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

1
2
Exception up = new Exception("Something is really wrong.");
throw up; //ha ha
1
2
//When I wrote this, only God and I understood that I was doing
//Now, God only knows

Some more here

134 Comments
  1. Rock permalink

    Muito bom!

    Adicione este que encontrei ano passado:


    If 1 > 0 Then
    'You deserve it
    MsgBox "ASS WIPE!"
    End If

  2. Muito bom, acho que vou utiliza-las em futuro próximo.

  3. aehuiaeu

    eu fiz uns assim esses dias:

    /*
    * here be dragons
    *
    * as vezes dá nullPoiterException por aqui.
    * não sei como, não sei porque, mas dá.
    * mas não deveria.
    *
    * RUN TO HILLS, manolo.
    */

  4. Hoje postei dois no Twitter que rachei de rir:

    // drunk, fix later
    // Magic. Do not touch.

  5. /* This can only happen when SEP is enabled, no need to test “SEP”arately */

    - Cerne linux, linha 215, arquivo arch/i386/kernel/vmi.c

  6. marukas permalink

    // if world whould be perfect we whouldn’t need such function because this is
    // non valid situation and it was caused by some very angry dirty nasty bugs

  7. Vladas permalink

    One of the lines in the code I need to maintain:

    //Do not touch this! it is automagically doing stuff.

  8. Robson permalink

    //GO Horse que serve pra funcionar no IE7

  9. WordPress


    endif; // if you delete this the sky will fall on your head

  10. Vinícius Krolow permalink

    Opa é verdade grande parte consta nesse link, mas na verdade eu digitei os comentários que recebi de um email com várias imagens, provávelmente essas imagens foram retiradas pelo site, grato pela fonte vou fazer relacionamento do post a fonte.

  11. g0dkar permalink

    Bom, eu sou famoso por usar uma certa função que salva minha vida quando o bug está impossível de ser resolvido: setAppellationMode(true); – ponho isso e alguns minutos depois (por coincidência ou não) encontro o bug e/ou a solução do problema. Geralmente a implementação é algo como:

    public void setAppellationMode(boolean appellationMode) {
    // Use a Força, pequeno padawan. A Força Bruta!
    return;
    }

  12. Hmm permalink

    I’ve found one as well (oracle):

    – got no time to apply the official formula — God save us

  13. Kept me giggling for a while – awesome post :)

  14. found in open source code:

    // Here we do all the work

    and then completed by me:

    // the hell you do! it’s all wrong! we did all the work!

  15. Silver permalink

    #recursion coment
    now I understand what’s recursion
    thanks man
    LoL

  16. alex permalink

    Recursion != Infinite loop.

  17. Mateus permalink

    Mas nenhum bate o /* Faz porra nenhuma */ em um dos items do switch() …

  18. Huaheuhauehauhe muito bom!
    To inspirado agora!

  19. Wow very funny stuff, this should see every coder, LOL ;D

  20. jami permalink

    I wrote a tiny script to build a fortune file from the stackoverflow “best code comment” post. (a few hundred entries). It would be really great if someone could collect this cool code comments and build a fortune mod officially package. I used it as motd and it totally sweetens my day :D

    script: http://pastebin.com/K5ygA
    other funny comments: http://stackoverflow.com/questions/184618q3x

  21. Parabens pelo artigo !
    Eu gostei muito de comentario “double penetration; // ouch” …
    No futuro, vou dar mais attenção nos comentarios das arquivas que eu vou mexer !

  22. Priceless !

  23. class Snake {
    Snake() { // Boa constructor
    }
    }

  24. Haha those were really funny comments.

    // total_hours_wasted_here = 16

    LoL epic

  25. obrigatório permalink

    Awesome ! That made my day, we want moar :)

  26. woody permalink

    абассаца

  27. Hahaa!!!
    Thx, that saved my day :P

  28. My favorite:

    stop(); // Hammertime!

  29. cool :)

    #define true false

  30. Johnny Lattouf permalink

    Hilarious

  31. Octavian permalink

    HaHa,

    Who says writing code is dull ???

    “double penetration;”… haha
    I remember some “sex” variable in some code.

    But try to write clean code to figure out cause cause later you’ll say
    “//Now, God only knows”

    Have some fun while you’re coding !!!

  32. my contribution, a SQL Server Proc:

    SP_Check_Anal

  33. I just about fell out of my chair when I read the “Rick-rolled” comment, absolutely brilliant find!

  34. LOOOOOOOOOOOOOL

    in a weak code sometimes it’s true!!!!!

    //I am not sure why this works but it fixes the problem.

  35. this wins the internet today!

  36. The Zimma permalink

    // If the function exists, run it, otherwise, don’t do anything (like Jeff).

  37. too funny. :)

  38. In a PL/I program many moons ago:

    DCL Kludge CHAR(1) STATIC INIT(‘~’); /* this stupid linker fails to iniitialize the first single-byte literal in a linked overlay. I you want some other character than the tilde to seem randomly broken, change the value in ticks */

  39. key permalink

    Here is one more funny code confessions
    http://thedailywtf.com/Articles/Davecpp.aspx

  40. funny list :) ))
    THIS IS SPARTA!:))))

  41. Sam permalink

    // we have tried everything…

    throw kitchen_sink;

  42. Rizel permalink

    In Spip Agora :
    // TODO : c quoi ce vieux residu ?

  43. haha funny !!

  44. alex permalink

    // To understand recursion, one must first understand recursion.

  45. kuangye permalink

    seems it’s Chinese English.

  46. Ahmed Eltawil permalink

    This just made my day. Hilarious :D

Trackbacks & Pingbacks

  1. Twitted by divoxx
  2. Twitted by thiagoarrais
  3. Twitted by gstiebler
  4. Twitted by yankooliveira
  5. Twitted by daltonmatos
  6. Twitted by msbrogli
  7. Twitted by jaakkokallio
  8. Top funny source code comments - Cristian’s blog
  9. Top funny source code comments | cObaia.net « Netcrema – creme de la social news via digg + delicious + stumpleupon + reddit
  10. Actualités | Les commentaires de codes informatiques les plus drôles | Tranquilou
  11. === popurls.com === popular today
  12. Les commentaires en programmation
  13. Top funny source code comments | cObaia.net : Popular Links : eConsultant
  14. Najzabawniejsze komentarze żródła - develway.pl
  15. De la joie Dans Ton Commentaire … | The Geek Bar
  16. it’s raining « fauve fibres
  17. Funniest Source Code Comments @DebraUlrich #Amplify #RecoveryRelief « The Recovery Relief Blog
  18. Los mejores comentarios de código de programadores | Pisito en Madrid
  19. bancuri super tari - Page 47
  20. Top funny source code comments « deconectat
  21. I commenti più divertenti dei programmatori
  22. Nexse Portal » Per farci due risate
  23. Comentarios de código graciosos | cObaia.net « HiperEidon
  24. pinboard October 2, 2010 — arghh.net
  25. IнTересные ссылки №9 (2010-10-08) | IнTересности
  26. Komentaras
  27. Quando si programma troppo… | DoppiaVu’s Blog
  28. blaufasan » source code comments
  29. Geeks with humor • Onderweg Blog
  30. Lessons of the Code Monkey
  31. Best of StumbleUpon #1 | Rambling On About Shit
  32. » for a lazy Sunday afternoon Alina
  33. Top funny source code comments | Lean Labs
  34. Funny source code comments « Karen Torres
  35. webKnjaZ » Смішні комментарі в коді (переклад)
  36. Koda yorum nasil yazilmali « @author cagri kilit
  37. Os 10 melhores comentários em código « Marcio Belo
  38. Comentarii de prin cod culese de la alții | Blog i-Consult
  39. Flogiston » More linux snippets
  40. Most funny source code comments « Digitale Dummy
  41. Most funny source code comments « Digitale Dummy
  42. The World In Links [5/2-5/15] - Nicholas Kreidberg | Nicholas Kreidberg
  43. Basi di programmazione #11: Commenti | techNoDin.org
  44. Funny Source Code Comments
  45. Funny Source Code Comments
  46. diversao
  47. Uge 3 | Twitologi
  48. Hidden Expressions « Hello Kleinkie

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS