Funniest / most useless computer programming comments...

Hey, this is global linguistically portable code. All you have to do is run a spanish to whatever translation program on all strings that match NUM_ROW_NUMERL, and the code can be instantly understood by someone who only speaks, say, Swahili.

My favorite comment (and code) block that I’ve seen in code I work with so far was

/* Check for new format if building new version */
#ifdef BUILD_OPTION_NEW_VERSION
if (state->new_float_format_type) {
#else
{
#endif
}

I’m sure that used to do something important.

Ah yes, I just remembered my favorite comment that I’ve seen.

There was this one cellular phone game I had to port, and the entirety of it was in a single function that did all the key-down/key-up checks, redraw timing, and game logic in a single large loop, like this:



while (true) {
   try {
      do {
         ...timing code...
         ...key state code...
         if (state == MENU) {
            if (state2 == MENU1) {
               ...draw menu screen...
               break;
            }
            else if (state2 == MENU2) {
               ...draw menu screen...
               break;
            }
            ..etc.
         }
         ...draw main game background...
         ...game logic...
         ...etc.
      }
      while (0);
   }
   catch (Exception e) {} //Keep going
}


“Keep going” :dubious:

Looking at the code I was so afraid of removing that try catch statement; it wouldn’t have surprised me a bit that he had simply had too many divide by zero, accessing a null pointer, or whatever errors without knowing why or where, or feeling like debugging it. So he just made the thing keep going regardless… :rolleyes:

Well now, he was just writing fault-tolerant code, don’t you see.

Sounds like the Visual Basic philosophy applied to C.

Only they make it easier for you there:

On Error Resume Next

One of my first programming gigs, I coded a genie named Rondar who lived in the computer.

I coded an internal array of threats that Rondar would issue periodically to the operators if the printer needed paper (“Feed Rondar, or Rondar will put your name on junk mailing lists”) or stuff like that.

The operators loved it, because it mostly ran on the midnight shift and they were bored. Trouble was, one of them liked it so much she nominated me for an internal customer service award, and my boss found out about it and made me remove it all.

This was the same boss who cussed me out for labeling the user interface subroutines Dr.-Doolittle. Because he could talk to the animals.

I only lasted there about a year.

Regards,
Shodan