Funniest/Most Annoying Code Comments

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

Moderators: phlip, Moderators General, Prelates

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 » Wed Oct 03, 2007 4:59 am UTC

Communal coding creates crazy crap:

Code: Select all

//This method is nonfunctional, reruns 24 every time. Suggestions? -Jeff

//Reruns of 24?! DO NOT FIX! -Harper

//I hate my keyboard and do believe you are an idiot. Fixed-Jeff

//Curses! Foiled again!-William
Wait. With a SPOON?!

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 Oct 03, 2007 5:03 am UTC

Google Code Search is fun!

I like link #4 here: http://www.google.com/codesearch?hl=en& ... tnG=Search
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

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 Oct 03, 2007 5:54 am UTC

adlaiff6 wrote:Google Code Search is fun!

I like link #4 here: http://www.google.com/codesearch?hl=en& ... tnG=Search


Google Code Search provided my ammunition the couple times someone has chastised MS for including a function ZeroMemory in addition to memset, even though it's trivial to do the former with the latter. ;-)

http://www.google.com/codesearch?hl=en&lr=&q=memset\s*\(.%2B%2C\s*0\s*\)&btnG=Search

[I would have linked that inline, but phpbb is apparently still buggy, so you have to copy and paste. Poor you.]

User avatar
phlip
Restorer of Worlds
Posts: 7572
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Funniest/Most Annoying Code Comments

Postby phlip » Wed Oct 03, 2007 6:36 am UTC

Backslashes are illegal in URIs and have to be escaped:
http://www.google.com/codesearch?hl=en& ... tnG=Search
Parens and asterisks are reserved in URIs, so sometimes have to be escaped, sometimes not... they don't have to be in the query part, but best to do it anyways.

phpBB isn't buggy, it just sticks to the spec slightly more rigidly than necessary.

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

Cynic
Posts: 39
Joined: Sun Oct 08, 2006 5:08 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby Cynic » Wed Oct 03, 2007 9:48 am UTC

Code: Select all

//The stack! Holds values of expressions.
//Angel: What stack? It's a bloody vector! Don't confuse people!
//Jono: It's a vector that is used like a stack! Makes more sense to name it as such.
vector<string> val_stack;

User avatar
Kudos
Posts: 28
Joined: Tue Oct 02, 2007 6:57 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby Kudos » Wed Oct 03, 2007 10:49 pm UTC

That google code search is pretty interesting.

Code: Select all

  1: // "stupid" seems an appropriate description for a language that can't split a string...
        // To be honest, I can't figure out how they screwed this up.  I'm trying
        // to imagine what the underlying split() code looks like, and I can't picture it.
        public class stupid
        {

boss_mc
Posts: 47
Joined: Thu Oct 04, 2007 12:03 am UTC

Re: Funniest/Most Annoying Code Comments

Postby boss_mc » Thu Oct 04, 2007 12:31 am UTC

While doing a summer job at a lovely computer systems company, I was set the daunting task of commenting the code of a piece of software that an old employee of the company had written (C++ and MFC). This was fairly routine work, most of the functions had names like 'convertDegreesToRadians(double degrees)' and the like but very few of them had any commenting at all. The ones that did on the other hand were not reliable with such genius comments as:

Code: Select all

/*
The drawDisk function draws a disk radius 'radius' units an the screen at the coordinates given.
*/
drawCube()


The drawDisk function did not exist anywhere and the drawCube drew a unit cube at the origin...

The author was a bit of a running joke in the office though (for such misdemeanors) but had somehow become a bigwig in some other company.
while ((*(iterator++) != (LExpression*)next) && (iterator != m_vector.end()){}

yet another one
Posts: 65
Joined: Fri Oct 05, 2007 9:36 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby yet another one » Fri Oct 05, 2007 9:51 pm UTC

Code: Select all

-- Just look at the name, i wish i could solve this problem with a better function
evilHack = read . (:) '0' . dropWhile (/= '.') . show :: Float -> Float
I wish I could use the following code, but due to some strange floating-point-thingies it didn't worked.

Code: Select all

f x = x - (fromIntegral $ floor x :: Float)
(This is Haskell)
At least we are the people.

redwards
Posts: 125
Joined: Tue May 22, 2007 8:46 pm UTC

Re:

Postby redwards » Mon Oct 08, 2007 9:47 pm UTC

Agent Anderson wrote:Not exactly a comment, but related to the spirit of this thread:

Exception up = new ArgumentException();
throw up;


In that vein:

#DEFINE EVER {;;}

for EVER {
//do stuff forever
}

User avatar
Govalant
Posts: 249
Joined: Mon Sep 17, 2007 2:50 am UTC
Location: Rosario, Argentina
Contact:

Re: Re:

Postby Govalant » Tue Oct 09, 2007 11:28 pm UTC

redwards wrote:
Agent Anderson wrote:Not exactly a comment, but related to the spirit of this thread:

Exception up = new ArgumentException();
throw up;


In that vein:

#DEFINE EVER {;;}

for EVER {
//do stuff forever
}


Both of them are so great
Now these points of data make a beautiful line.

How's things?
-Entropy is winning.

roman_pearce
Posts: 4
Joined: Fri Oct 12, 2007 8:11 am UTC

Re: Funniest/Most Annoying Code Comments

Postby roman_pearce » Fri Oct 12, 2007 9:04 am UTC

Before an unintelligible performance critical 3 line hack, in a high level programming language:

# BLACK MAGIC

which it was.

User avatar
fryman
Posts: 50
Joined: Mon Aug 20, 2007 7:11 pm UTC
Location: In a box, sitting next to a cat.

Re: Funniest/Most Annoying Code Comments

Postby fryman » Fri Oct 12, 2007 6:29 pm UTC

From a hash checking program:

Code: Select all

return 1;   //oh shit we should never reach this
Open source sigs? Here, use mine!

User avatar
biolution
Ken
Posts: 560
Joined: Wed Sep 05, 2007 10:05 pm UTC
Location: San Francisco, Ca
Contact:

Re: Funniest/Most Annoying Code Comments

Postby biolution » Sat Oct 13, 2007 12:11 am UTC

something i wrote the other day:

Code: Select all

// this uses variable variables.
// you're not expected to understand this.
foreach($this as $var => $null) {
  if(isset($$var)) {
    $this->$var = $$var;
  }
}


This one made me laugh:

Code: Select all

$kidHerder = $childSpec->childrenGetter;
$kids = $object->$kidHerder();

User avatar
stormgren
Posts: 80
Joined: Wed May 16, 2007 11:09 pm UTC
Location: over the hills and far away

Re: Funniest/Most Annoying Code Comments

Postby stormgren » Sat Oct 13, 2007 1:11 am UTC

I don't have any comments but when I was a programmer for a MUD a few years ago every variable name was something like wibble, wobble, fluff, bing, and so on.

So it was common to get stuff like

Code: Select all

foreach(bing in fluff) {
  wibble += ({bing, fluff[bing]});
}
//Don't ask about the syntax, it was LPC.


Ahh, such memories.

User avatar
TomBot
Posts: 228
Joined: Sun Jul 29, 2007 1:17 am UTC
Location: Illinois (UIUC)
Contact:

Re: Funniest/Most Annoying Code Comments

Postby TomBot » Sat Oct 13, 2007 3:26 am UTC

As for annoying, you're all forgetting the worst kind - when huge swaths of code are commented out with no explanation. Sometimes it's the body of a function, sometimes it's a bunch of destructors, sometimes it's every occurance printf scattered through the code. Occasionally it will have someone's username written near it. Those are helpful because they tell you whom to kill.

I was grading an MP awhile ago and saw this:

Code: Select all

public:
  Disk();                  /**< MAKE ZE HARD DRIVE                         */
  Disk(int, char*);        /**< (ID, Filename) Constructor                 */
  ~Disk();                 /**< SMASH HARD DRIVE                           */

mrkite
Posts: 336
Joined: Tue Sep 04, 2007 8:48 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby mrkite » Sat Oct 13, 2007 6:26 am UTC

TomBot wrote:As for annoying, you're all forgetting the worst kind - when huge swaths of code are commented out with no explanation.


I do that occasionally. But i'll put a comment in svn.

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

Re: Funniest/Most Annoying Code Comments

Postby EvanED » Sat Oct 13, 2007 7:33 am UTC

TomBot wrote:As for annoying, you're all forgetting the worst kind - when huge swaths of code are commented out with no explanation. Sometimes it's the body of a function, sometimes it's a bunch of destructors, sometimes it's every occurance printf scattered through the code. Occasionally it will have someone's username written near it. Those are helpful because they tell you whom to kill.

I was grading an MP awhile ago and saw this:

Code: Select all

public:
  Disk();                  /**< MAKE ZE HARD DRIVE                         */
  Disk(int, char*);        /**< (ID, Filename) Constructor                 */
  ~Disk();                 /**< SMASH HARD DRIVE                           */

The other kind of comments that are really annoying is when people use /* */ comments for single line comments when programing in a language that supports // comments. :roll:

(Heck, I find multiline /* */ comments...)

Defenestrator
Posts: 8
Joined: Thu Sep 13, 2007 8:58 am UTC

Re: Funniest/Most Annoying Code Comments

Postby Defenestrator » Sat Oct 13, 2007 10:48 am UTC

biolution wrote:

Code: Select all

$kidHerder = $childSpec->childrenGetter;
$kids = $object->$kidHerder();
That reminds me of some code I wrote once:

Code: Select all

function killChildren(node) {
  while (node.firstChild) node.removeChild(node.firstChild);
}

sgware
Posts: 34
Joined: Sat Oct 13, 2007 7:18 am UTC

Re: Funniest/Most Annoying Code Comments

Postby sgware » Sat Oct 13, 2007 6:18 pm UTC

// Proof of the existence of evil
...code here...

This went atop some PHP code in a Drupal module I was writing. It was a method that built and ran eval() functions which built and ran other eval() functions within themselves. If only I still had the code... it was both a thing of beauty and a hideous abomination of nature.
One day, I hope to change the world. Now if only they would give me the source code...

User avatar
wr3cktangle
Posts: 75
Joined: Tue Aug 01, 2006 5:03 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby wr3cktangle » Mon Oct 15, 2007 8:57 pm UTC

Here's some more of mine from VB homework assignments
part of the assignment was to provide an About Me form

Code: Select all

'allow the user to edit my bio if they hit the secret button, f4.
If e.KeyCode = Keys.F4 Then
  txtBio.ReadOnly = Not txtBio.ReadOnly
End If

i'd hide easter eggs like this in a lot of my programs just for fun.

here's one of a way to cheat on a math quiz game
shift-clicking the label at the top that read "MATH!" would cause it to display the answers instead
this was partially used in testing, and partially because it's more fun to cheat.

Code: Select all

'omgwtfbbqhax!!!!!one!!!!!eleven!!!!11!!!!1!!!
'if the user is holding shift and clicks lblTitle
'then show the answer to the problem
If shiftDown Then
   lblTitle.Text = "answer: " & cAnswer
Else
   lblTitle.Text = "MATH!"
End If

one more from an assignment that required the inclusion of an image
i found a black and white .gif of bob saget that flipped the colors and was offset slightly to give it a continuously rotating look

Code: Select all

'Bob Saget has been known to cause seizures
Maxim 33. When faced with the unusual, self-destruct.
My blog

the human perl script
Posts: 69
Joined: Mon Jun 11, 2007 2:37 pm UTC

Re:

Postby the human perl script » Mon Oct 15, 2007 9:16 pm UTC

wing wrote:String name; //Creates a String called name
I see things like that ALL THE TIME in intro CS classes.

I'll see your intro CS classes and raise you a XX-KLOC web-app with somewhere in the region of 5000 users. And apart from these, the code is completely devoid of comments.

Sometimes the voices tell me to do bad things.

maafy6
Posts: 102
Joined: Wed Aug 22, 2007 10:43 pm UTC

Re: Re:

Postby maafy6 » Mon Oct 15, 2007 11:10 pm UTC

the human perl script wrote:Sometimes the voices tell me to do bad things.


Yes, but even they are not reason enough to not comment your code.

Edit: Quote nesting where it shouldn't be.

User avatar
lazarus89
Posts: 485
Joined: Tue Oct 16, 2007 2:22 am UTC
Location: God's Armpit, USA

Re:

Postby lazarus89 » Tue Oct 16, 2007 1:20 pm UTC

@trophy wrote:This is my personal favorite:

Code: Select all

/*¤***********************************************************

     *                                                           *

     *  .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.       *

     *   |                     ______                     |      *

     *   |                  .-"      "-.                  |      *

     *   |                 /            \                 |      *

     *   |     _          |              |          _     |      *

     *   |    ( \         |,  .-.  .-.  ,|         / )    |      *

     *   |     > "=._     | )(__/  \__)( |     _.=" <     |      *

     *   |    (_/"=._"=._ |/     /\     \| _.="_.="\_)    |      *

     *   |           "=._"(_     ^^     _)"_.="           |      *

     *   |               "=\__|IIIIII|__/="               |      *

     *   |              _.="| \IIIIII/ |"=._              |      *

     *   |    _     _.="_.="\          /"=._"=._     _    |      *

     *   |   ( \_.="_.="     `--------`     "=._"=._/ )   |      *

     *   |    > _.="                            "=._ <    |      *

     *   |   (_/                                    \_)   |      *

     *   |                                                |      *

     *   '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='      *

     *                                                           *

     *      LASCIATE OGNI SPERANZA, VOI CH'ENTRATE               *

     *************************************************************/


I seem to recall seeing this in the original UNIX regular expression code... where is this one from?
pedant wrote:You drove your car off a cliff. Moments before your car hit the ground, I plugged you right between the eyes with a sniper rifle. Your car hits the ground and creates a dramatic fireball. How did you die?

Awesomely.

Taikoen
Posts: 1
Joined: Wed Oct 17, 2007 2:44 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby Taikoen » Wed Oct 17, 2007 3:24 pm UTC

I usually write very easy to read and well-commented code, but when I knew my old boss was going to be looking at the code relatively soon I'd play with the code like this:

Code: Select all

// I'm hungry.
foreach (microwave in kitchen)
{
     // Who put a DVR in the microwave?
     microwave.DVRSelect();

     // Hot potato!
     foreach (potato in microwave)
     {
          // w t f
          potato.CameraSelect();
     }
}
I very often use inanimate objects and animals as my variable names, a habit which I routinely find causes problems when I go on-site to train users how to use our compiler/code generation/web development tool. It's very fun to watch people trying to understand the capacity of a piece of fabric their company produces in a variable called 'frog.'

A previous company I worked for several years ago had a couple different places in the source code where they had comments in their try/catch blocks that looked like this:

Code: Select all

// if you ever get this you must be an idiot :)

Also, that same company would automate their testing. A friend called me over to his desk one day to show me an error message that the automation program had thrown in a pop-up window without elucidating:

Code: Select all

Error: Excepted Success But Failed.

User avatar
KingAl
Posts: 78
Joined: Sun May 27, 2007 3:50 am UTC

Re: Funniest/Most Annoying Code Comments

Postby KingAl » Thu Oct 18, 2007 2:30 am UTC

<snip>
Last edited by KingAl on Sun Dec 30, 2007 3:48 am UTC, edited 1 time in total.

User avatar
biolution
Ken
Posts: 560
Joined: Wed Sep 05, 2007 10:05 pm UTC
Location: San Francisco, Ca
Contact:

Re: Funniest/Most Annoying Code Comments

Postby biolution » Thu Oct 18, 2007 3:02 am UTC

Taikoen wrote:

Code: Select all

Error: Excepted Success But Failed.


That reminds me of a Dreamweaver error I remember seeing a lot:

Error: Operation completed successfully

User avatar
phlip
Restorer of Worlds
Posts: 7572
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Funniest/Most Annoying Code Comments

Postby phlip » Thu Oct 18, 2007 3:31 am UTC

biolution wrote:
Error: Operation completed successfully

That happens if there's a function somewhere that doesn't use SetLastError() when it fails, but the caller thinks it does... the caller calls GetLastError(), which returns 0, and error message 0 is "The operation completed successfully."

For this reason, my generic error handler doesn't grab the error message if the error code is 0, and just displays a completely generic "something went wrong" message... not that helpful, but better than saying "everything worked, and this is a problem"...

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

User avatar
Pathway
Leon Sumbitches...?
Posts: 647
Joined: Sun Oct 15, 2006 5:59 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby Pathway » Fri Oct 19, 2007 8:24 am UTC

Code: Select all

int smallestPopularity = 2147483647;
      // initialized to 2147483647
      // because that's the biggest
      // possible value for an int, so
      // if the smallest popularity is
      // bigger than that, things have
      // all gone mad anyway
SargeZT wrote:Oh dear no, I love penguins. They're my favorite animal ever besides cows.

The reason I would kill penguins would be, no one ever, ever fucking kills penguins.

User avatar
aldimond
Otter-duck
Posts: 2665
Joined: Fri Nov 03, 2006 8:52 am UTC
Location: Uptown, Chicago
Contact:

Re: Funniest/Most Annoying Code Comments

Postby aldimond » Sat Oct 20, 2007 6:48 am UTC

This is how one writes a loop to search a linked list in x86 assembler (lots of references to constants/labels defined in other places, you knew that... and the calling convention is irregular for x86, that was part of the assignment). This is my code from about 2 years ago. I was being very silly.

Code: Select all

        cmpw $2000, %ax                 # If 'location' is not in bound
        jae go_fish                     # Surely it will not be found

        movl mp1_list_head, %ecx        # Set up ECX, EDX
        movl mp1_list_ptr, %edx
loop_start:
        testl %ecx, %ecx                # If past end of list, exit
        jz go_fish
        cmpw LOCATION(%ecx), %ax       # If the glove fits...
        je you_cant_acquit
        leal NEXT(%ecx), %edx           # Update them loop invariants
        movl (%edx), %ecx
        jmp loop_start
go_fish:
        xorl %ecx, %ecx                 # If the location test fails ECX!=0 yet
you_cant_acquit:
        ret
One of these days my desk is going to collapse in the middle and all its weight will come down on my knee and tear my new fake ACL. It could be tomorrow. This is my concern.

jtniehof
Posts: 312
Joined: Mon Sep 10, 2007 9:00 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby jtniehof » Sat Oct 20, 2007 3:30 pm UTC

Pathway wrote:

Code: Select all

int smallestPopularity = 2147483647;

Wow. Seems like it'd make a lot more sense just to initialize to maxInt...more evidence that clear code and smart choice of variable names can trump comments.

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

Re: Funniest/Most Annoying Code Comments

Postby EvanED » Sat Oct 20, 2007 11:47 pm UTC

jtniehof wrote:
Pathway wrote:

Code: Select all

int smallestPopularity = 2147483647;

Wow. Seems like it'd make a lot more sense just to initialize to maxInt...more evidence that clear code and smart choice of variable names can trump comments.

But using MAX_INT would make it so the system would continue to work if it was ported a (granted, fairly infrequent) system with integers that aren't 32 bits. It's not sporting if you don't require some debugging effort for such ports.

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 Oct 26, 2007 3:11 pm UTC

This topic got me looking back through some of my code for some comments. Anything we deliver to our client, I gotta remove any funny/sarcastic comments for professionalism, but one thing I've been making standard is to include an ASCII rendition of our company's name and logo at the bottom of those.

As for non-final programs... I started a "Useless Code" folder. One program I put there was meant to demonstrate use of the 'sleep' command (this is in SAS, which is 4th-gen so it should be easy to interpret):

Code: Select all

/* Create sleep seconds */
%let n = 1;

/* Create neverending macro */
%macro horse;
   %put %sysfunc(sleep(&n.));
%mend horse;

%macro glue_factory(macro);
   %do %until(&n.<0);
      %&macro.;
   %end;
%mend glue_factory;

/* Put computer to sleep */
%glue_factory(horse);


Oh, and whenever I happen to need a 'dead code' section, I always stick in ASCII art of ghosts and tombstones.

Unfortunately I can't find much more in the way of funny code comments. I usually remove them before saving the final version of a program to avoid problems.

Oh, and there is some code we've received from earlier contractors that, from my own irritation, I stuck in a bunch of disparaging comments. But... some of those comments might identify said companies, so I'd rather not post them. KF
~Kizyr
Image

abzde
Posts: 10
Joined: Thu Aug 16, 2007 7:43 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby abzde » Fri Oct 26, 2007 10:27 pm UTC

one of the more recent things i've been doing with python wrote:

Code: Select all

/*look, the code below here doesn't work. it it tried to do what the above code does, but, failed miserably. i'm not going to remove it, GET OVER IT.*/


i have something similar to that in almost everything i make \o/

User avatar
aldimond
Otter-duck
Posts: 2665
Joined: Fri Nov 03, 2006 8:52 am UTC
Location: Uptown, Chicago
Contact:

Re: Funniest/Most Annoying Code Comments

Postby aldimond » Sat Oct 27, 2007 1:42 am UTC

In the codebase I work on there are lots of comments written to vent frustration about how much VB5 and MySQL 4 suck.

My favorite that I've seen is "LAST TRAIN TO HACK-CENTRAL!"
One of these days my desk is going to collapse in the middle and all its weight will come down on my knee and tear my new fake ACL. It could be tomorrow. This is my concern.

Aii
Posts: 5
Joined: Thu Oct 25, 2007 7:18 am UTC
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Aii » Sat Oct 27, 2007 11:35 am UTC

Someone mentioned the Half-Life source earlier in the thread, a lot of the amusing tidbits are summed up here:
http://botman.planethalflife.gamespy.com/humor.shtml
See also: Aaeriele

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 Oct 27, 2007 11:54 am UTC

abzde wrote:
one of the more recent things i've been doing with python wrote:

Code: Select all

/*look, the code below here doesn't work. it it tried to do what the above code does, but, failed miserably. i'm not going to remove it, GET OVER IT.*/


i have something similar to that in almost everything i make \o/

Python doesn't have /**/ comments...

User avatar
RRRR
Posts: 31
Joined: Sun Oct 28, 2007 3:27 am UTC
Location: Wollongong, Australia
Contact:

Re: Funniest/Most Annoying Code Comments

Postby RRRR » Sun Oct 28, 2007 9:36 am UTC

I feel like crying almost every week at work... We have a UniBasic/UniData system which comprises well over 1000 programs, yet alone subroutines and I frequently find code such as

Code: Select all

610*
GO 620
620*


Code: Select all

IF ODLIMIT = 0 AND BALANCE > ODLIMIT THEN BALANCE = ODLIMIT * 100

Really thought that one out aye?

In the maintenance log of a 3000+ line phantom process

Code: Select all

*@@@@ #3145 namewithheld 15 Oct 2005
*     CA.CNT isn't set to anything. Set CA.CNT and CT.CNT to
*     AP.CNT and hopes it works...

Not the sort of comment you want to see in a banks production code, more so when you know the bug you are looking for relates to CA.CNT...


We had a production program die with a message box saying "Error: 20"

After searching our VB code base for that helpfully message, I find

Code: Select all

This error can not happen

Smells like wishful thinking?


In a C#/ASP .NET production system, distributed Australia wide. Well into 5 digit line count.
Almost every catch statement for exceptions contains 1 line

Code: Select all

// TODO - Errors won't happen


No wonder they left for new jobs as soon as they implemented it. Since I've started there, I got dumped with supporting this system (fault tracing, developing patches). I don't know whether to cry or scream everytime I look at it...
If not now, when? If not me, who?

CaraInFrames wrote:RRRR is purrrty.
:D

abzde
Posts: 10
Joined: Thu Aug 16, 2007 7:43 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby abzde » Sun Oct 28, 2007 4:49 pm UTC

Dingbats wrote:
abzde wrote:
one of the more recent things i've been doing with python wrote:

Code: Select all

/*look, the code below here doesn't work. it it tried to do what the above code does, but, failed miserably. i'm not going to remove it, GET OVER IT.*/


i have something similar to that in almost everything i make \o/

Python doesn't have /**/ comments...


yeah, that wasn't supposed to say python, but i just didn't change it because i wanted to see how long/if anyone would point out the fact that it isn't python

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 » Mon Oct 29, 2007 12:32 am UTC

abzde wrote:yeah, that wasn't supposed to say python, but i just didn't change it because i wanted to see how long/if anyone would point out the fact that it isn't python

Well, somebody did. You can now record the results of your experiment. No further discussion of this is needed and we can go back to posting funny/annoying comments.
"What's wrong with you mathematicians? Cake is never a problem."

User avatar
FiddleMath
Posts: 245
Joined: Wed Oct 11, 2006 7:46 am UTC
Location: Madison, WI
Contact:

Re: Funniest/Most Annoying Code Comments

Postby FiddleMath » Mon Oct 29, 2007 9:12 pm UTC

I just found this line of Python in an subversion diff, and I'm trying to figure out what it was and if I should commit it or not:

Code: Select all

        faults.append((testCase.number, f)) #Hax.

I'm thinking, probably not.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 10 guests