Funniest/Most Annoying Code Comments

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
Dingbats
Posts: 921
Joined: Tue Mar 20, 2007 12:46 pm UTC
Location: Sweden
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Dingbats » Sat Nov 24, 2007 9:31 am UTC

'; DROP DATABASE;-- wrote:
Dongorath wrote:Alas I had to clean the comments from the code (code meant for production, might be read by the clients), but I left this at the beginning :

Code: Select all

// WW5mcHZuZ3IgYnRhciBmY3JlbmFtbiwgaWJ2IHB1J3ZhZ2VuZ3I=
I'm sure you'll figure what it means :mrgreen:

Before cleaning, you could see my mind slowly drifiting into madness...
I got as far as it being Italian, but Google couldn't make any sense of it ("Let ogne hope you ch'intrate").

"Abandon all hope, ye who enter here"?

User avatar
epoch_qwert
Posts: 2
Joined: Sat Nov 24, 2007 9:20 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby epoch_qwert » Sat Nov 24, 2007 9:31 pm UTC

[how do I delete my posts?]
Last edited by epoch_qwert on Sun Jul 10, 2016 11:53 am UTC, edited 1 time in total.

a5an0
Posts: 6
Joined: Thu Nov 15, 2007 7:43 am UTC

Re: Funniest/Most Annoying Code Comments

Postby a5an0 » Mon Nov 26, 2007 7:22 am UTC

/* Dear Java,
Please make char[] -> String conversion less ghetto.
Love, Alex */

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Funniest/Most Annoying Code Comments

Postby Rysto » Mon Nov 26, 2007 7:23 am UTC

a5an0 wrote:/* Dear Java,
Please make char[] -> String conversion less ghetto.
Love, Alex */

???

String s = new String(myCharArray);

a5an0
Posts: 6
Joined: Thu Nov 15, 2007 7:43 am UTC

Re: Funniest/Most Annoying Code Comments

Postby a5an0 » Mon Nov 26, 2007 7:42 am UTC

Oh, sorry, I need to put that in context. I needed to do array slicing (a la python), and I couldn't find an easy way to do it in Java, so I hacked up a method. That comment was at the end.

Dongorath
Posts: 93
Joined: Tue Oct 16, 2007 1:17 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby Dongorath » Mon Nov 26, 2007 10:10 am UTC

Dingbats wrote:
'; DROP DATABASE;-- wrote:
Dongorath wrote:Alas I had to clean the comments from the code (code meant for production, might be read by the clients), but I left this at the beginning :

Code: Select all

// WW5mcHZuZ3IgYnRhciBmY3JlbmFtbiwgaWJ2IHB1J3ZhZ2VuZ3I=
I'm sure you'll figure what it means :mrgreen:

Before cleaning, you could see my mind slowly drifiting into madness...
I got as far as it being Italian, but Google couldn't make any sense of it ("Let ogne hope you ch'intrate").

"Abandon all hope, ye who enter here"?

Yep, that one :mrgreen:

User avatar
FractalNinja
Posts: 22
Joined: Tue Nov 27, 2007 1:42 am UTC

Re: Funniest/Most Annoying Code Comments

Postby FractalNinja » Wed Nov 28, 2007 9:27 pm UTC

On one of my Computer Science tests (to save you time, the code segment is an if statement for (grd == 11):

Code: Select all

if((grd % 2 == 1) && (grd > 9) && (grd < 13)) str = "Junior"; //SCREW YOU, OCCAM!!!


I know the reference is a stretch, but whatever.

I also did something similar in my SAT test book, but no one else will ever see it...

User avatar
Xeio
Friends, Faidites, Countrymen
Posts: 5101
Joined: Wed Jul 25, 2007 11:12 am UTC
Location: C:\Users\Xeio\
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Xeio » Thu Nov 29, 2007 3:10 am UTC

FractalNinja wrote:On one of my Computer Science tests (to save you time, the code segment is an if statement for (grd == 11):

Code: Select all

if((grd % 2 == 1) && (grd > 9) && (grd < 13)) str = "Junior"; //SCREW YOU, OCCAM!!!


I know the reference is a stretch, but whatever.

I also did something similar in my SAT test book, but no one else will ever see it...


I can see (at least) one of my previous professors marking off points for something like that because its too complicated and should be simpler. :X

I usually write weird comments on all my tests now, its pretty funny when I get them back and theres more comments written though...

Question had something to do with making an object eligible for garbage collection (in a linked list I think), can't recall exactly how it was phrased though.

Code: Select all

//Death to A.next!!! --- My comment
A.next = null;
//Its dead! --- Professor's comment

btilly
Posts: 1877
Joined: Tue Nov 06, 2007 7:08 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby btilly » Thu Nov 29, 2007 3:32 am UTC

Here is a random one I just noticed it in a quote file.

Code: Select all

double value;                /* or your money back! */
short changed;               /* so triple your money back! */

(from cons.c in the Perl source code).
Some of us exist to find out what can and can't be done.

Others exist to hold the beer.

bray
Posts: 67
Joined: Wed Aug 15, 2007 4:17 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby bray » Fri Nov 30, 2007 6:27 pm UTC

Xeio wrote:
FractalNinja wrote:On one of my Computer Science tests (to save you time, the code segment is an if statement for (grd == 11):

Code: Select all

if((grd % 2 == 1) && (grd > 9) && (grd < 13)) str = "Junior"; //SCREW YOU, OCCAM!!!


I know the reference is a stretch, but whatever.

I also did something similar in my SAT test book, but no one else will ever see it...


I can see (at least) one of my previous professors marking off points for something like that because its too complicated and should be simpler. :X


As someone who is occasionally forced to grade exams, let me say that I would definitely take off points for that. People who deliberately make my life more difficult for no reason deserve to be punished.

User avatar
FractalNinja
Posts: 22
Joined: Tue Nov 27, 2007 1:42 am UTC

Re: Funniest/Most Annoying Code Comments

Postby FractalNinja » Fri Nov 30, 2007 8:52 pm UTC

bray wrote:
Xeio wrote:
FractalNinja wrote:On one of my Computer Science tests (to save you time, the code segment is an if statement for (grd == 11):

Code: Select all

if((grd % 2 == 1) && (grd > 9) && (grd < 13)) str = "Junior"; //SCREW YOU, OCCAM!!!


I know the reference is a stretch, but whatever.

I also did something similar in my SAT test book, but no one else will ever see it...


I can see (at least) one of my previous professors marking off points for something like that because its too complicated and should be simpler. :X


As someone who is occasionally forced to grade exams, let me say that I would definitely take off points for that. People who deliberately make my life more difficult for no reason deserve to be punished.


You guys don't know my teacher. First of all, he reads XKCD, and also plays WOW all the time. He is probably the coolest teacher ever. In fact, I'm doing this IN HIS CLASS RIGHT NOW, but he doesn't mind because he knows I get it.

Also, I should point out that the other three if statements were

Code: Select all

if(grd == 9) ...
else if(grd == 10) ...
else (the posted line)
else if (grd == 12)...

So it was obvious I knew how it should have been done.

My point is, I'm not an idiot. Usually.
Image
My Psychobilly Radio Station

User avatar
cypherpunk
Posts: 8
Joined: Sat Dec 01, 2007 5:39 am UTC

Re: Funniest/Most Annoying Code Comments

Postby cypherpunk » Sat Dec 01, 2007 6:19 am UTC

I've been doing an assignment where I have to write a theatre-ticket-buying system using RPC and RMI. Being a C-kinda guy, I wrote the RPC one first. The main program loop is delimited by labels start and end, and there's about 6 or so goto's that jump to them, normally on failures to do with not being able to find tickets.

So I have something like

Code: Select all

start:
...
if(yn == 'y')
  goto start;
else
  goto end;
...
end:


The RMI code is essentially the same code, just ported over to Java. Of course, Java (like many poor craftsmen) chooses to blame the tools, so no goto. They do, however, have these wonderful named loops. My RMI program looks something like this:

Code: Select all

goto_considered_harmful: while(true) { //Oh wait, Dijkstra wasn't a programmer, I don't care what he thinks
...
if(yn.equals("y"))
  continue goto_considered_harmful;
else
  break goto_considered_harmful;
...
} //Knuth, though, he knows where it's at.


Ayup.

User avatar
Xeio
Friends, Faidites, Countrymen
Posts: 5101
Joined: Wed Jul 25, 2007 11:12 am UTC
Location: C:\Users\Xeio\
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Xeio » Sat Dec 01, 2007 8:20 am UTC

cypherpunk wrote:

Code: Select all

goto_considered_harmful: while(true) { //Oh wait, Dijkstra wasn't a programmer, I don't care what he thinks
...
if(yn.equals("y"))
  continue goto_considered_harmful;
else
  break goto_considered_harmful;
...
} //Knuth, though, he knows where it's at.


Ayup.


Heh, the website for my current programming class is dijkstra.cs.iit.edu, my professor is a big fan of him. :X

cypherpunk wrote:Of course, Java (like many poor craftsmen) chooses to blame the tools


Yea, it happens. I see no reason not to use GOTO, as long as the programmer isn't an idiot about it. :mrgreen:

btilly
Posts: 1877
Joined: Tue Nov 06, 2007 7:08 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby btilly » Sat Dec 01, 2007 5:43 pm UTC

cypherpunk wrote:The RMI code is essentially the same code, just ported over to Java. Of course, Java (like many poor craftsmen) chooses to blame the tools, so no goto. They do, however, have these wonderful named loops.


There is a reason that Java has no goto. Which is that they actually read Knuth. He has a comment there about a theorem that says that any algorithm that can be written with goto can be written exactly as efficiently out of it if you have named loop control. The other useful use he identified is better done by exceptions, leaving no useful uses of goto.

This is not entirely true. Perl has the same basic facilities that Java has, but I've still seen 3 useful uses of traditional goto in Perl over the years. (Perl has 2 gotos, and the other is moderately useful on occasion.) The first was in s2p, it was easier to turn goto's in sed into goto's in Perl than to try to rewrite with labelled loop control. The other two times it was used because someone needed a construct that had to interact correctly with any combination of flow of control constructs written by other programmers. None of those situations should show up in normal programming.
Some of us exist to find out what can and can't be done.

Others exist to hold the beer.

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Funniest/Most Annoying Code Comments

Postby Rysto » Sat Dec 01, 2007 11:48 pm UTC

I'm with Java on this one. You absolutely should not be using goto to implement a loop. That's what looping constructs are there for.

btilly
Posts: 1877
Joined: Tue Nov 06, 2007 7:08 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby btilly » Sun Dec 02, 2007 2:56 am UTC

Rysto wrote:I'm with Java on this one. You absolutely should not be using goto to implement a loop. That's what looping constructs are there for.

Just to be clear, in C and C++ you sometimes have no choice. If you have nested loops and need to break out early, it is more efficient to use goto. That was the main point of Knuth's famous paper Structured Programming with go to Statements.

That said, in C/C++ you can hide the gotos behind a preprocessor macro like so:

Code: Select all

    #define named(name) goto name; name##_break: if (0) name:
    #define break(name) goto name##_break;

    /* Which then allows you to write... */

    named (LOOPS) for (i=1; i<10; i++) {
                    for (j=1; j<10; j++) {
                      for (j=1; j<10; j++) {
                        /* Process data[i][j][k] here */
                        if (data[i][j][k] < threshold) break(LOOPS);
                      }
                    }
                  }

(I got those macros from Damian Conway. See http://www.perlmonks.org/?node_id=126056.)
Some of us exist to find out what can and can't be done.

Others exist to hold the beer.

Powder
Posts: 7
Joined: Mon Sep 03, 2007 5:38 am UTC
Location: OKC
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Powder » Mon Dec 03, 2007 12:59 am UTC

From the Velociraptor Simulation program I found on Google Code.

Code: Select all

!rightRaptor.updatePosition(STEP, joe); //if none of the raptors caught Joe, then he's still alive
joe.updatePosition(STEP, joe); //run joe run!

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Funniest/Most Annoying Code Comments

Postby Rysto » Mon Dec 03, 2007 1:31 am UTC

btilly wrote:Just to be clear, in C and C++ you sometimes have no choice. If you have nested loops and need to break out early, it is more efficient to use goto. That was the main point of Knuth's famous paper Structured Programming with go to Statements.

I didn't say that I was against the use of goto for breaking out of loops. What I am against is the use of goto to make a loop.

btilly
Posts: 1877
Joined: Tue Nov 06, 2007 7:08 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby btilly » Mon Dec 03, 2007 4:00 am UTC

Rysto wrote:
btilly wrote:Just to be clear, in C and C++ you sometimes have no choice. If you have nested loops and need to break out early, it is more efficient to use goto. That was the main point of Knuth's famous paper Structured Programming with go to Statements.

I didn't say that I was against the use of goto for breaking out of loops. What I am against is the use of goto to make a loop.

Ah. Well. That's because you're sane. :)
Some of us exist to find out what can and can't be done.

Others exist to hold the beer.

User avatar
Antimatter Spork
Posts: 679
Joined: Tue Nov 27, 2007 3:13 am UTC
Location: The third planet from the sun.

Re: Funniest/Most Annoying Code Comments

Postby Antimatter Spork » Mon Dec 03, 2007 5:01 am UTC

In my CS class, whenever I was declaring a function that took two doubles as parameters, I would do this:

Code: Select all

void dostuff(double, double); //toil and trouble
Albert Schweitzer wrote:There are two means of refuge from the misery of life — music and cats.

Tiax
Posts: 53
Joined: Wed Aug 29, 2007 3:22 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby Tiax » Mon Dec 03, 2007 5:14 am UTC

Not quite an annoying code comment, but my debugging System.out's in try-catch statements are always try {...} catch (Exception e) {System.out.println("Oh noes!");}

ravenhearte
Posts: 32
Joined: Sun Nov 18, 2007 10:57 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby ravenhearte » Mon Dec 03, 2007 1:25 pm UTC

From a class my friend is taking. He was getting a little tired with the simple programming assignments.

Code: Select all

/*   Purpose: To demonstrate the effect of operator precedence. I presume.
**   Algorithm: 1. Test unparenthesized expression.
**   2. Test parenthesized expression.
**   3. Ponder the results.
*/

#include <stdio.h>

int main(void)
{
   printf("Operator Order Demonstratorer\n\tBy <name ommited>");

   {
      int a = 1, b =2, c = 3;
      a += b += c +=7;
      printf("%s%d", "\na = ", a);
      printf("%s%d", "\nb = ", b);
      printf("%s%d", "\nc = ", c);
   }

   {
      int a = 1, b =2, c = 3;
      a += (b += (c +=7)); //Should be equivalent to the above statement
      //given right to left execution of equally precedent operators.
      printf("%s%d", "\na = ", a);
      printf("%s%d", "\nb = ", b);
      printf("%s%d", "\nc = ", c);
      printf("\n");
      //And it is!
   }
   return 0;
}


edit: said friend just sent me this too. Sent me the executable first. I had no idea what I was looking at.

Code: Select all

/*   Purpose: To test the effect of a continue statement in the body of a for loop.
**   Algorithm: 1. Enter for loop.
**   2. put char(acters).
**   3. continue; on our merry way.
**  Note: Having your fingers on ctrl + break is helpful.
*/

#include <stdio.h>

int main(void)
{
   for (putchar('1'); putchar('2'); putchar('3'))
   {
      putchar('4');
      continue;
      putchar('5');
   }
   //output is: 1243243243243243243243243243243243243243243243243243243243
   //243243243243243243243243243243243243243243243243243243243243243243...
   return 0;
}
Last edited by ravenhearte on Mon Dec 03, 2007 1:46 pm UTC, edited 1 time in total.

User avatar
pieaholicx
The cake is a lie!
Posts: 531
Joined: Mon Oct 22, 2007 12:51 pm UTC
Contact:

Re: Funniest/Most Annoying Code Comments

Postby pieaholicx » Mon Dec 03, 2007 1:46 pm UTC

I've put a few ones in my code recently. One that I'm not going to try to copy (it's on a whole different network) is a paragraph long rant about how bad Weblogic's classes are, and that most of them don't have getters for half the variables, but have multiple setters for the rest.

A little later down I have a "more magic" moment:

Code: Select all

//These integers need to stay out of the substring statement
//They cause an ArrayOutOfBoundsException if they're in it


They seriously do, which is kind of weird, since they're just two indexOf statements on the string I'm substringing.
It's okay, I'm Chaotic Neutral. I can kill him over the loot.
Overexposure to pieaholicx may, in semi-rare cases, emancipate dental fillings, crowns, tooth enamel, and teeth.

User avatar
Nexus_1101
Posts: 196
Joined: Mon Nov 05, 2007 2:59 pm UTC
Location: Brighton, England, UK
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Nexus_1101 » Tue Dec 04, 2007 7:58 pm UTC

The best i had was when i was trying to get an old app of mine to work after reading through all the code i found this:

Code: Select all

int ComplicatedFunction()
{
  //TODO: create the function and get this program working 25/10/2004
  return 0;
}

i couldn't belive it, i was such a lazy git.
HOSTING -> Heroquest
:idea: CHAOS BONUS :idea:

Code: Select all

IF (NOTFORUMGAME()) {
    postcount.add(1);
}

User avatar
Hurduser
Posts: 285
Joined: Tue Dec 04, 2007 6:14 pm UTC
Location: Esperantujo

Re: Funniest/Most Annoying Code Comments

Postby Hurduser » Tue Dec 04, 2007 10:51 pm UTC

Long story: Our CS guy in chief told us that we'd be able to use Linux for the C++ programming assignments, but made the frameworks so horrible to use that I spent often hours adjusting it (I was new to C++), thus, I thought if I have to d extra work to write it, he should do extra work to read it and named everything in Esperanto. In this program I translated some Pascal-code to C++ for a certain purpose, at one point it was late and I wrote:

Code: Select all

    provizora.x = (int)(provizora.x + cosinus_feld[provizora.direkto] * pliigajxo());//sikian Code
    provizora.y = (int)(provizora.y + sinus_feld[provizora.direkto]* pliigajxo());  // from VW(l: integer);
    if (hazarda(6)>2)                                                              //from here on no longer 
    {                                                                             //
      if (gxenerala_direkto<provizora.direkto)                                   //
      {                                                                         //
        if (provizora.direkto - gxenerala_direkto < 180)                       //
        {                                                                     //
          provizora.direkto+=pliigajxo();                                    //
        }else                                                               //
        {                                                                  //
          provizora.direkto-=pliigajxo();                                 //
        }                                                                //
      } else                                                            //
      {                                                                //
        if (gxenerala_direkto - provizora.direkto < 180)              //
        {                                                            //
          provizora.direkto+=pliigajxo();                           //
        } else                                                     //
        {                                                         //
          provizora.direkto-=pliigajxo();                        //
        }                                                       //
      }                                                        //
    }                                                         //
    glBegin(GL_POINTS);                                      //


From the same program:

Code: Select all

/*============================================================================*/
/*  !!OWN CODE!!                                                              */
/*                                                                            */
/*  !!Increased bug-density!!                                                 */

From another one by the same teacher:

Code: Select all

  // since my TurboPascal-time when computers had 3-digit amounts of MHz (and 2 where behind the decimal point), it's done like that!


I translated the comments to English

Of course I did the obvious PASCAL joke more than once:

Code: Select all

var
  god: integer; (*god is not real!*)
Frag mal nach im IRC
'zum Kotzen' das heisst dort XP.
Win2k, nur so zum staunen,
hat mehr Bugs als nur zweitausend.

User avatar
segmentation fault
Posts: 1770
Joined: Wed Dec 05, 2007 4:10 pm UTC
Location: Nu Jersey
Contact:

Re: Funniest/Most Annoying Code Comments

Postby segmentation fault » Wed Dec 05, 2007 8:11 pm UTC

i used to maintain code that was the epitome of spaghetti and had little to no comments. the one (exactly one) comment in one of the files was next to an if statement:

Code: Select all

//is this possible?


i know it normally wouldnt be that funny but when its the ONLY comment in a file, i cant help but groan with extreme volume.

also my old boss had gone into one of the files and made comments to try and organize what the code was actually doing (it was REALLY bad code). he wrote a couple of hilarious comments, i cant remember most of them off hand, but one of the funnier ones was:

Code: Select all

if (type == 2) {  // if we are of magical type 2
    i = 0; // reset that magical counter
    ...
}


and yes the variables were actually named "type" and "i", im not just using them because i forgot the actual names.
people are like LDL cholesterol for the internet

User avatar
jordan
Posts: 106
Joined: Thu Mar 15, 2007 2:41 pm UTC
Location: Coventry

Re: Funniest/Most Annoying Code Comments

Postby jordan » Sat Dec 08, 2007 5:40 pm UTC

I love this one from Wikipedia's IE7 stylesheet:

Code: Select all

/* This bit is needed to make links clickable... WTF */


My own comments tend to consist of dry exposition with occasional apologies:

Code: Select all

# I'm really, really sorry about this. Maybe we can talk about it over lunch?


Extremely annoyed that I couldn't use 'target="_blank"' in XHTML 1.0 Strict, and writing a script to remedy this:

Code: Select all

/* This cynically fixes a problem the W3C created by wilfully destroying a well-defined,
 * extremely useful standard so that they could sleep at night in their ivory towers.
 */


When I finally found the ubiquitous "magic number":

Code: Select all

// I could tell you how I got this figure, but then I'd have to kill you.


And lastly, the "I've lost all hope/better remove this before shipping" comment:

Code: Select all

/* Normally my functions aren't this complicated, but this is an exception because FUCKING HELL THIS IS FUCKING IMPOSSIBLE JESUS FUCKING CHRIST */

enraged_bee
Posts: 7
Joined: Tue Dec 11, 2007 4:48 am UTC

Re: Funniest/Most Annoying Code Comments

Postby enraged_bee » Tue Dec 11, 2007 6:35 am UTC

I'm learning Python, and, of course, I suck at coding due to inexperience.

Code: Select all

# ummmm fix this later on


I'm also fairly random.

Code: Select all

# give a hug to mumsy, would you?

User avatar
'; DROP DATABASE;--
Posts: 3284
Joined: Thu Nov 22, 2007 9:38 am UTC
Location: Midwest Alberta, where it's STILL snowy
Contact:

Re: Funniest/Most Annoying Code Comments

Postby '; DROP DATABASE;-- » Tue Dec 11, 2007 6:55 am UTC

jordan wrote:Extremely annoyed that I couldn't use 'target="_blank"' in XHTML 1.0 Strict
You mean they finally decided web pages shouldn't be able to spawn new windows!? I think this calls for a celebration.
poxic wrote:You suck. And simultaneously rock. I think you've invented a new state of being.

User avatar
Geekthras
3) What if it's delicious?
Posts: 529
Joined: Wed Oct 03, 2007 4:23 am UTC
Location: Around Boston, MA

Re: Funniest/Most Annoying Code Comments

Postby Geekthras » Tue Dec 11, 2007 7:05 am UTC

I remember being pissed about the fact that my IDE in java wasn't working, so to make sure there was no conflict with other similarly named things, I renamed a subclass FUCK, a method BASTARD, and a member of it WHORE.
Wait. With a SPOON?!

User avatar
segmentation fault
Posts: 1770
Joined: Wed Dec 05, 2007 4:10 pm UTC
Location: Nu Jersey
Contact:

Re: Funniest/Most Annoying Code Comments

Postby segmentation fault » Tue Dec 11, 2007 8:48 pm UTC

just saw this today:

Code: Select all

// WTF is this???
mpMediaInterface->createConnection(mConnectionId, szLocalAddress, 0, NULL, NULL, pNewCall->getMessageQueue()) ;


i highly doubt WTF are his/her initials.

heres another interesting one:

Code: Select all

if (success)
{
  // Do something with this success?
}
Last edited by segmentation fault on Tue Dec 11, 2007 8:51 pm UTC, edited 1 time in total.
people are like LDL cholesterol for the internet

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Funniest/Most Annoying Code Comments

Postby EvanED » Tue Dec 11, 2007 8:50 pm UTC

segmentation fault wrote:just saw this today:

Code: Select all

// WTF is this???
mpMediaInterface->createConnection(mConnectionId, szLocalAddress, 0, NULL, NULL, pNewCall->getMessageQueue()) ;


i highly doubt WTF are his/her initials.

Although that would be great, wouldn't it?

If I had a last name beginning with "F", I would totally consider doing that when I had a kid. ;-)

User avatar
'; DROP DATABASE;--
Posts: 3284
Joined: Thu Nov 22, 2007 9:38 am UTC
Location: Midwest Alberta, where it's STILL snowy
Contact:

Re: Funniest/Most Annoying Code Comments

Postby '; DROP DATABASE;-- » Wed Dec 12, 2007 12:48 am UTC

William The First?
poxic wrote:You suck. And simultaneously rock. I think you've invented a new state of being.

yaPete
Posts: 31
Joined: Wed Nov 28, 2007 8:25 am UTC

Re: Funniest/Most Annoying Code Comments

Postby yaPete » Wed Dec 12, 2007 1:34 am UTC

Here are a few I have handy (sure I've seen better):

Code: Select all

catch (IOException e ) {
    // Swallowing exceptions is evil.
    // I am evil.
    // It's a wash.
}


Code: Select all

public class ServerTalkingGobbeldygookException extends Exception {


Code: Select all

   public JdbcDataStore(Database db) throws SQLException
   {
      //                             _
      //                            / \
      //    ________________________|_|___________________________
      //   /_____________________________________________________/|
      //  |                                                     | |
      //  |                          +                          | |
      //  |   WARNING: you are now entering an area of nicely   | |
      //  |   formatted table instantiations, with each column  | |
      //  |       of a table on a separate line for ease of     | |
      //  |                      reference.                     | |
      //  |                                                     | |
      //  |         *** AUTOFORMATTERS WILL BE SHOT ***         | |
      //  |            (Survivors will be shot again)           | |
      //  |        (That includes re-indenting this sign)       | |
      //  |                          +                          | |
      //  |_____________________________________________________|/
      //                            | |
      //                            | |
      //                            | |          @
      //                          \ | | /        |/
      //                          \\|||//       \|


Code: Select all

    catch (IOException e)
    {
        // If this is a file we can't handle, then we can't handle
        // the file.
    }


Code: Select all

    catch (ExternalException e)
    {
        return null; // FIRE IN THE HOLE
    }


Code: Select all

    // TODO: tell someone or other that we couldn't do
    // something or other


Code: Select all

// Err, erm... errmmm.... BUG!


Code: Select all

// Eww, yuck yuck yuck, bad evil deprecated code ahead.


Code: Select all

// This allows us to detect obscenity in all the languages of man


Code: Select all

      // This doesn't need to be here at all. Why the hell is it
      // here twice?

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Funniest/Most Annoying Code Comments

Postby EvanED » Wed Dec 12, 2007 1:36 am UTC

yaPete, I enjoyed those.

yaPete
Posts: 31
Joined: Wed Nov 28, 2007 8:25 am UTC

Re: Funniest/Most Annoying Code Comments

Postby yaPete » Wed Dec 12, 2007 1:39 am UTC

Tiax wrote:Not quite an annoying code comment, but my debugging System.out's in try-catch statements are always try {...} catch (Exception e) {System.out.println("Oh noes!");}


Would you not rather see the handy messages and stack-traces from the exception, than a trite and silly comment that might, perhaps, downhill-with-a-following-wind, have raised a small chuckle when it was new and original?

Pete

User avatar
adlaiff6
Posts: 274
Joined: Fri Nov 10, 2006 6:08 am UTC
Location: Wouldn't you rather know how fast I'm going?
Contact:

Re: Funniest/Most Annoying Code Comments

Postby adlaiff6 » Wed Dec 12, 2007 5:53 am UTC

I took a peek at Google's code to parse out units and such for Google Calculator when I was an intern there, and there are some pretty good ones there (if you didn't know already, http://www.google.com/search?hl=en&q=%28mark+twain+*+e%29+jiggers+*+once+in+a+blue+moon+per+cubic+yard isn't very fast). Unfortunately, I don't remember them and would probably get shot for posting them anyway.
3.14159265... wrote:What about quantization? we DO live in a integer world?

crp wrote:oh, i thought you meant the entire funtion was f(n) = (-1)^n
i's like girls u crazy

User avatar
abrenecki
Posts: 62
Joined: Mon Sep 10, 2007 8:39 am UTC
Location: Mid North SA, Australia

Re: Funniest/Most Annoying Code Comments

Postby abrenecki » Thu Dec 13, 2007 9:42 am UTC

I found the following code on Work Experience for a company that does web design and programming for some reasonably large companies, inside some fucking colossal file I didn't have access to for the first 4 hours - I was looking at the production copy too:

Code: Select all

function doSomething(){
   return false; //because we're lazy
}

Part of their CMS. There was also some code that returned itself, as I remember, and most of the things I didn't get were in some markup language they'd made up in files that were parsed into PHP and eval()d around line 2100 of the same fucking massive file. Surely the [acronym for name of product]ML could be parsed in it's own file. Anyway, enough of my rant.

User avatar
Kizyr
Posts: 2070
Joined: Wed Nov 15, 2006 4:16 am UTC
Location: Virginia
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Kizyr » Fri Dec 14, 2007 3:20 pm UTC

Here's an example of a neverending macro loop that I give:

Code: Select all

* Neverending macro;
%macro test_macro8c(number_of_lights);
   %do %until(&number_of_lights.=5);
      %put There are &number_of_lights. lights;
   %end;
%mend test_macro8c;
%test_macro8c(4);


Hopefully some people will catch the reference. KF
~Kizyr
Image

User avatar
Hammer
Because all of you look like nails.
Posts: 5491
Joined: Thu May 03, 2007 7:32 pm UTC
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Hammer » Fri Dec 14, 2007 3:31 pm UTC

Kizyr wrote:Hopefully some people will catch the reference. KF

I get it. And I may never forgive myself.
"What's wrong with you mathematicians? Cake is never a problem."


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 7 guests