Funniest/Most Annoying Code Comments

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

Moderators: phlip, Moderators General, Prelates

User avatar
Cosmologicon
Posts: 1806
Joined: Sat Nov 25, 2006 9:47 am UTC
Location: Cambridge MA USA
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Cosmologicon » Sat Feb 02, 2008 4:40 am UTC

Nice, but, um, shouldn't the 24½th century be 2350-2449?

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

Re: Funniest/Most Annoying Code Comments

Postby btilly » Sun Feb 03, 2008 12:16 am UTC

Cosmologicon wrote:Nice, but, um, shouldn't the 24½th century be 2350-2449?

D'oh. I'll have to fix that on Monday.
Some of us exist to find out what can and can't be done.

Others exist to hold the beer.

Jvr_Rz
Posts: 4
Joined: Sun Feb 03, 2008 11:39 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby Jvr_Rz » Mon Feb 04, 2008 12:01 am UTC

Might seem funny, but it is actually somewhat necessary.... isn't it?

I'm coding the direct kinematics of a parallel robot in MATLAB, plotting everything in 3D. One of the auxiliary points i'm using is called 'gx'


Code: Select all

scatter3(gx(1,:),gx(2,:),gx(3,:),'gx') %lol but the first gx is because it's the 3D position of point g and the last 'gx' is for 'green, x marker'



Used in another robotics simulation (also MATLAB... programmed kinda on-the-fly)

Code: Select all

function whichcase=identifyCase()
   
    global ROBPOS;

    %it could simply be done with THETA but then where's the fun?
   
    x3=get(ROBPOS(3),'Xdata');
    x1=get(ROBPOS(1),'Xdata');
   
   
    if(x3>=x1)
        whichcase=1; %(down)
    else
        whichcase=2; %up
    end

    %ok, I probably didn't need a separate function for this... but it's done...
   
return




Some dots playing 'tag':

Code: Select all

            %run away from the wall so I won't get cornered:
           
            %%%%%%OPTION 1: THE WAY I ORIGINALLY THOUGHT%%%%%%%
            %%%%%%OPTION 2: AT FIRST I DIDN'T PROGRAM IT THE WAY I'D THOUGHT; I MADE A MISTAKE BUT I THINK IT WORKS BETTER

            option=2;
           
            switch(option)
                case 1
...

User avatar
Malsies
Posts: 168
Joined: Tue Aug 21, 2007 3:48 pm UTC
Location: Wes' Flo-dae
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Malsies » Mon Feb 04, 2008 10:44 pm UTC

I'm pretty new at programming. I'm learning C++, Java, and Perl. All this semester.

On one assignment, I commented with the entirety of "Dance Commander." It had been stuck in my head for a week straight, and I thought that writing it out might help. My professor was like "WTF Mallory," but he didn't take off points any at least.
I slice, I dice, and I fit comfortably into your pocket or glove-box!

(Order in the next ten minutes, and get a second for FREE!)

User avatar
enk
Posts: 754
Joined: Mon Sep 10, 2007 12:20 am UTC
Location: Aalborg, Denmark
Contact:

Re: Funniest/Most Annoying Code Comments

Postby enk » Tue Feb 05, 2008 2:34 pm UTC

Malsies wrote:I'm pretty new at programming. I'm learning C++, Java, and Perl. All this semester.

On one assignment, I commented with the entirety of "Dance Commander." It had been stuck in my head for a week straight, and I thought that writing it out might help. My professor was like "WTF Mallory," but he didn't take off points any at least.


It truly is a catchy song ..but wtf?! :)
phlip wrote:Ha HA! Recycled emacs jokes.

Jeremysr
Posts: 4
Joined: Fri Oct 05, 2007 3:43 am UTC

Re: Funniest/Most Annoying Code Comments

Postby Jeremysr » Tue Feb 05, 2008 11:46 pm UTC

Here's some that I found in my programs directory:

Code: Select all

// Main screen turn on

The Nintendo DS's top screen is called the "main" screen, so I had to write that of course when setting up the top screen.

Code: Select all

// Debugging code starts here
// End debugging code

There was nothing between those lines... :?

Code: Select all

-- The keyboard doesn't seem to detect the first button pressed, but then detects the second one and all the ones afterward. This line will fix that by pretending they pressed a button.

Easy way to fix code that I didn't understand (even though I wrote it). :lol:

And now some from some websites I helped make (so a lot of comments here aren't from me):

Code: Select all

$m_content = nl2br($_POST['content']);

// Prevent hacking/cracking/defacing
$m_content = str_replace("<", "&lt;", $m_content);
$m_content = str_replace(">", "&gt;", $m_content);

// Whoops
$m_content = str_replace("&lt;br /&gt;", "<br />", $m_content);

Haha, I changed newlines into <br />, then changed all the <'s and >'s into HTML entities. This was my way of solving it. :lol:

Code: Select all

// Get everything

Pointless comment :P

Code: Select all

//Console is my

What??

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 Feb 06, 2008 12:53 am UTC

Jeremysr wrote:

Code: Select all

// Main screen turn on

The Nintendo DS's top screen is called the "main" screen, so I had to write that of course when setting up the top screen.
Hah, I do the same thing. (And to be pedantic, you can choose which screen is the main screen.)

I also did similar in a window message handler. Things like:

case WM_CREATE: //Main screen turn on!
case WM_COMMAND: //We get signal
case WM_LBUTTONUP: //Take off every left button!
case WM_CLOSE: //Somebody set up us the bomb.
default: //What!
etc.
poxic wrote:You suck. And simultaneously rock. I think you've invented a new state of being.

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

Re: Funniest/Most Annoying Code Comments

Postby jtniehof » Thu Feb 07, 2008 2:59 pm UTC

btilly wrote:date_to => "2450-01-01",

Thus guaranteeing your code will be running something critical for the next 500 years and causing the dreaded Y2k45 bug.

(although I've been guilty of saying "If this code is still in use in 2100, it'll be someone else's problem.)

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Berengal » Thu Feb 07, 2008 11:21 pm UTC

In 2450 we've got sentinent machines able to read comments.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

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;-- » Fri Feb 08, 2008 8:46 am UTC

Code: Select all

/*
Warning: this code is rated PG13 for explicit lyrics.
*/

[...]

//This is a massive fucking hack to work around the most retarded fucking thing EVER,
//namely, the fact that you get these fucking messages BEFORE THE FUCKING DIALOG IS
//FUCKING CREATED, which fucks everything the fuck up.

I went through the next day and "cleaned up" most of the angry comments, but decided to leave that one. :mrgreen:
poxic wrote:You suck. And simultaneously rock. I think you've invented a new state of being.

a-priori
Posts: 3
Joined: Fri Feb 08, 2008 6:47 am UTC

Re: Funniest/Most Annoying Code Comments

Postby a-priori » Fri Feb 08, 2008 3:44 pm UTC

Why, just the other day I wrote this lovely bit of Javascript code!

Code: Select all

        // Yes, this is ugly. Blame Javascript's fucked up idea of
        // what "closure" means.
        item.click((function(id) {
            return function() {
                ui_switch_tab(id);
            }
        })(tab.id));


And yes, Javascript does have fucked up notions of closures. That's actually the cleanest code I could come up with to get around this asshattery.

User avatar
hotaru
Posts: 1045
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby hotaru » Fri Feb 08, 2008 7:16 pm UTC

a-priori wrote:

Code: Select all

        // Yes, this is ugly. Blame Javascript's fucked up idea of
        // what "closure" means.
        item.click((function(id) {
            return function() {
                ui_switch_tab(id);
            }
        })(tab.id));


And yes, Javascript does have fucked up notions of closures. That's actually the cleanest code I could come up with to get around this asshattery.

this doesn't work?

Code: Select all

item.click(function(){ui_switch_tab(tab.id);});

Code: Select all

factorial product enumFromTo 1
isPrime n 
factorial (1) `mod== 1

User avatar
El Senor Fruit Swing
Posts: 1048
Joined: Thu Dec 06, 2007 3:57 pm UTC
Location: Michigan
Contact:

Re: Funniest/Most Annoying Code Comments

Postby El Senor Fruit Swing » Fri Feb 08, 2008 7:30 pm UTC

I put this in my stock function i made for class
it kept looping..
//BBQSAUCE PWNED
Raiku wrote: Oh, I 'Falcon Punched' a tree for the hell of it, and it's still quite bloody...

Goplat
Posts: 490
Joined: Sun Mar 04, 2007 11:41 pm UTC

Re: Funniest/Most Annoying Code Comments

Postby Goplat » Fri Feb 08, 2008 11:37 pm UTC

Cosmologicon wrote:Nice, but, um, shouldn't the 24½th century be 2350-2449?
No it shouldn't. AD years start at 1, so the 1st century was 1-100, the 2nd century was 101-200, and in general the Nth century is from 100N-99 to 100N.

Drake
Posts: 62
Joined: Thu Feb 07, 2008 3:53 am UTC

Re: Funniest/Most Annoying Code Comments

Postby Drake » Fri Feb 08, 2008 11:46 pm UTC

I just got "handed" a program to update and edit. The previous programmer decided graduate shool wasn't for him and dropped out. After combing through 22 files of sparse commenting, single letter variable names and uncalled for Generic abuse, I think I figured out when he began to lose interest...


Code: Select all

   public static void printSTR(String[] blah){
       for(int i = 0; i < blah.length; i++){
          System.out.println(blah[i]);
       }
    }

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 » Sat Feb 09, 2008 3:00 am UTC

hotaru wrote:this doesn't work?

Code: Select all

item.click(function(){ui_switch_tab(tab.id);});

Not if tab.id changes after that line... which is annoying if you have some kind of loop... for example:

Code: Select all

for (i = 0; i < 10; i++)
{
  nodes[i].addEventListener("click", function(){thingClicked(i)}, false);
}
will call thingClicked(10) whichever node you click on. However, if you do:

Code: Select all

for (i = 0; i < 10; i++)
{
  nodes[i].addEventListener("click", function(id){return function(){thingClicked(id)}}(i), false);
}
then it does what you want.

Since that's hard to read, I'll generally do:

Code: Select all

// make new scope for id
function makeThingClickedClosure(id)
{
  return function(){thingClicked(id)}
}
// ...
for (i = 0; i < 10; i++)
{
  nodes[i].addEventListener("click", makeThingClickedClosure(i), false);
}
... some of my more complicated JS code is littered with such closure-making functions.

Code: Select all

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

User avatar
b.i.o
Green is the loneliest number
Posts: 2519
Joined: Fri Jul 27, 2007 4:38 pm UTC
Location: Hong Kong

Re: Funniest/Most Annoying Code Comments

Postby b.i.o » Sat Feb 09, 2008 6:44 am UTC

Goplat wrote:
Cosmologicon wrote:Nice, but, um, shouldn't the 24½th century be 2350-2449?
No it shouldn't. AD years start at 1, so the 1st century was 1-100, the 2nd century was 101-200, and in general the Nth century is from 100N-99 to 100N.


Yes, so the 24th century would be from 2300-2399, and the 24½th would be 50 years later...2350 to 2449.....

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 Feb 09, 2008 8:07 am UTC

Silver2Falcon wrote:
Goplat wrote:
Cosmologicon wrote:Nice, but, um, shouldn't the 24½th century be 2350-2449?
No it shouldn't. AD years start at 1, so the 1st century was 1-100, the 2nd century was 101-200, and in general the Nth century is from 100N-99 to 100N.


Yes, so the 24th century would be from 2300-2399, and the 24½th would be 50 years later...2350 to 2449.....

You're off by one... 2301-2400 and 2351-2450.

That said, the original post was more or less correct as far as it goes.

akashra
Posts: 503
Joined: Tue Jan 01, 2008 6:54 am UTC
Location: Melbourne, AU
Contact:

Re: Funniest/Most Annoying Code Comments

Postby akashra » Sat Feb 09, 2008 8:53 am UTC

Some snippets from the current project I'm working on include:

Code: Select all

            // If the field is empty, or does not contain a #, it is of
            // unspecified type.
            if (sField.trim().length() < 1)
            {
               // TODO explaination? --tjsr
            }


Before a 6 line regular expression:

Code: Select all

// Commence ascii-factory explosion sequence... (read:  it gets the job done, okay?)


- Multiple references to Scott not being allowed to write code after having been drinking
- Frequent use of variables named 'zork', 'foo', 'sigh' (sigh++) and 'evil' (evil++)

Code: Select all

/**
 * It took me a full uni semester of studying just this stuff to
 * get my head around it.  Please don't touch, even if you
 * think you know what you're doing.
 **/


Comment from me in a DirectX engine I as working on:

Code: Select all

// Now I remember why I liked working on the GBA --tjsr
( find / -name \*base\* -exec chown us : us { } \ ; )

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 Feb 09, 2008 9:38 pm UTC

phlip wrote:some of my more complicated JS code is littered with such closure-making functions.


For long running javascript apps its actually better to have those closure making functions (i call them function generators, personally) because it prevents memory "leaks" (function(id) will have a reference to the dom node, and that prevents garbage collection).

A similar problem occurs with loops and lambdas in python.

User avatar
b.i.o
Green is the loneliest number
Posts: 2519
Joined: Fri Jul 27, 2007 4:38 pm UTC
Location: Hong Kong

Re: Funniest/Most Annoying Code Comments

Postby b.i.o » Sat Feb 09, 2008 10:09 pm UTC

EvanED wrote:
Silver2Falcon wrote:
Goplat wrote:
Cosmologicon wrote:Nice, but, um, shouldn't the 24½th century be 2350-2449?
No it shouldn't. AD years start at 1, so the 1st century was 1-100, the 2nd century was 101-200, and in general the Nth century is from 100N-99 to 100N.


Yes, so the 24th century would be from 2300-2399, and the 24½th would be 50 years later...2350 to 2449.....

You're off by one... 2301-2400 and 2351-2450.

That said, the original post was more or less correct as far as it goes.


Oops, that's correct, thanks.

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

Re: Funniest/Most Annoying Code Comments

Postby btilly » Sat Feb 09, 2008 11:59 pm UTC

biolution wrote:
phlip wrote:some of my more complicated JS code is littered with such closure-making functions.


For long running javascript apps its actually better to have those closure making functions (i call them function generators, personally) because it prevents memory "leaks" (function(id) will have a reference to the dom node, and that prevents garbage collection).

A similar problem occurs with loops and lambdas in python.

If garbage collection works properly, then that garbage will get collected.

That said, Internet Explorer's garbage collection is crap.
Some of us exist to find out what can and can't be done.

Others exist to hold the beer.

User avatar
Vanguard
Posts: 807
Joined: Mon Nov 19, 2007 3:52 pm UTC
Location: Away from you

Re: Funniest/Most Annoying Code Comments

Postby Vanguard » Mon Feb 11, 2008 3:08 pm UTC

I'm totally using "Main Screen Turn On" some day.

Code: Select all

/* Look, ma! I can code! */
Image

User avatar
Dropzone
Posts: 405
Joined: Sun Dec 30, 2007 10:12 pm UTC
Location: North Lincs., UK

Re: Funniest/Most Annoying Code Comments

Postby Dropzone » Mon Feb 11, 2008 5:29 pm UTC

Found this in some code I was looking at:

Code: Select all

   call runindex(bridgemiddlecheckslopeok)
   //setfragmentsize 26 <-- crap
   jmp short $+2+18
At least it's short and to the point, I guess...

wizzfizz
Posts: 23
Joined: Thu Aug 16, 2007 4:43 am UTC
Location: Perth, Western Australia

Re: Funniest/Most Annoying Code Comments

Postby wizzfizz » Tue Feb 12, 2008 1:18 am UTC

Ah yes, working with some Classic ASP today...

Code: Select all

'Is it worth it, let me work it
'I put my thing down, flip it and reverse it
'Ti esrever dna ti pilf, nwod gniht ym tup I

NextIP = StrReverse(UserRecordset.Fields.Item(0))
Said the Cat. "We're all mad here. I'm mad. You're mad."
"How do you know I'm mad?" said Alice.
"You must be," said the Cat. "or you wouldn't have come here."

User avatar
0xDEADBEEF
Posts: 284
Joined: Wed Jan 30, 2008 6:05 am UTC
Location: Austin, TX
Contact:

Re: Funniest/Most Annoying Code Comments

Postby 0xDEADBEEF » Tue Feb 12, 2008 2:55 am UTC

Code: Select all

"""
This is a test function.  It is used to test things.
We test things because we don't like it when shit breaks.
Cause that is bad, very bad.
"""


I should say here that I work for a telecom company...we like it when the phone goes off-hook!

Code: Select all

# woo hoo!  somebody answered!  go get that money!
def off_hook (self, id, pre_time=0):


This one's in C....and it's a good thing we switched to subversion!

Code: Select all

   
/* why you ask?  you didn't ask, well i'm going to tell you any way */
/* so shut the fuck (cvsfuckcount++) up. */

User avatar
rrwoods
Posts: 1509
Joined: Mon Sep 24, 2007 5:57 pm UTC
Location: US

Re: Funniest/Most Annoying Code Comments

Postby rrwoods » Tue Feb 12, 2008 2:22 pm UTC

This one is the typical newbie over-commenting mistake, but this was in our code (and might still be (I brought it up in a code review but I'm not sure it was ever removed)):

Code: Select all

// set i to be zero
i = 0;


The thing is, the function this was in was extremely complicated and not obvious in the slightest, and this was the only comment in it.
31/M/taken/US
age/gender/interest/country

Belial wrote:The sex card is tournament legal. And I am tapping it for, like, six mana.

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 » Tue Feb 12, 2008 6:38 pm UTC

rrwoods wrote:This one is the typical newbie over-commenting mistake, but this was in our code (and might still be (I brought it up in a code review but I'm not sure it was ever removed)):

Code: Select all

// set i to be zero
i = 0;


The thing is, the function this was in was extremely complicated and not obvious in the slightest, and this was the only comment in it.


Ugh, the only thing worse than that are comments from outsourced engineers:

Code: Select all

// this is to in which set i to 0 in order to set initial value

Code: Select all

/**
 * String in which string value on edit and on create page is stored as order from user.
 * @type String
 */
pulbic $order;


Never mind that $order is actually an order number

I have read complete paragraphs of comments like that, my wtf's/min goes through the roof.

Another favourite: After seeing them use abbreviations like 'str', 'bWhatever', 'txn', 'uehfMap', etc, we told them to use full names for their variables, not abbreviations.

Code: Select all

// We have 80 chars/line limit
---------0---------0---------0---------0---------0---------0---------0---------0
class GeneralLedgerTicket {  ...snip...
 function validate() { ...snip...
  $generalLedgerRequiredFieldsMapping = array();
  foreach(self::$generalLedgerFieldsMapping as $generalLedgerFieldKey =>
    $generalLedgerFieldValue) {
    if(isset($this->$generalLedgerFieldKey)) {
      $generalLedgerTypeMapping = $this->getGeneralLedgerFieldsTypeMapping();
      foreach($generalLedgerTypeMapping as $generalLedgerTypeKey =>
       $generalLedgerTypeValue) {
       if($generalLedgerFieldKey == $generalLedgerTypeKey &&
          !array_key_exists($generalLedgerFieldKey,
           $generaLedgerRequiredFieldsMapping)) {
         if($generalLedgerTypeValue == "text" || $generalLedgerTypeValue == "select"
           || $generalledgeTypeValue == "multi") {
            $generalLedgerRequiredFieldsMapping[$generalLedgerFieldKey] =
              $generalLedgerFieldValue;
          }
         }
        }
       }
      }
      $generalLedgerRequiredDateFields = array();
      ...repeat the above, but for $generalLedgerTypeValue == "date"
      $generalledgerRequiredNumberFields = array();
      ...repeat the above, but for $generaLedgerTypevalue == "int"
  }
 }


Thats from memory, so it probably has a few errors, but I swear to god, one time I saw a line break within the [] operators.

User avatar
bavardage
Posts: 253
Joined: Sun Apr 15, 2007 11:38 pm UTC
Contact:

Re: Funniest/Most Annoying Code Comments

Postby bavardage » Wed Feb 20, 2008 7:21 pm UTC

Just found in tuxfiles.org page source:

Code: Select all

<!-- So, you little PERV like to have a lookie lookie at other websites' sources, huh? Well, luckily I don't mind, so feel free to check out this source and do whatever dirty pervertic things you fantasize about. -->

<!-- Oh... one more thing: CSS r0x0rz j00 b0x0rz!!! :-P -->
'It can't be software incompatibility - the Trodden Spiral was designed for concentric rings, idiot ...'

Noughmad
Posts: 41
Joined: Wed Jan 09, 2008 8:38 pm UTC
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Noughmad » Wed Feb 20, 2008 11:36 pm UTC

bavardage wrote:Just found in tuxfiles.org page source:

Code: Select all

<!-- So, you little PERV like to have a lookie lookie at other websites' sources, huh? Well, luckily I don't mind, so feel free to check out this source and do whatever dirty pervertic things you fantasize about. -->

<!-- Oh... one more thing: CSS r0x0rz j00 b0x0rz!!! :-P -->
Which ends with the obligatory

Code: Select all

<!-- Wow... you're still reading this?! You need to get out more. -->
:)
Laziness is the mother of wisdom.
My woblag

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Funniest/Most Annoying Code Comments

Postby Berengal » Fri Feb 22, 2008 12:30 am UTC

While exploring JUnit and jython, I came upon this:

Code: Select all

public class TestSuite implements Test {

   /**
    * ...as the moon sets over the early morning Merlin, Oregon
    * mountains, our intrepid adventurers type...
    */
   static public Test createTest(Class<? extends TestCase> theClass, String name) {


It gave me the encouragement I needed to code for at least an hour more.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

scarletmanuka
Posts: 533
Joined: Wed Oct 17, 2007 4:29 am UTC
Location: Perth, Western Australia

Re: Funniest/Most Annoying Code Comments

Postby scarletmanuka » Fri Feb 22, 2008 8:09 am UTC

I do have to admit to this, present for a while in the code associated with my (mathematics) thesis project:

Code: Select all

...
DoBoxes(false);
...
FastVaporise;     // Does this actually do anything?
                  // Or is it the same as DoBoxes(false); ?
In the end it turned out that another routine wasn't doing what I'd written it to do, and when I fixed that it worked well enough that I didn't need the FastVaporise procedure anyway, so the whole section wound up being commented out.

LauraSakura
Posts: 18
Joined: Fri Feb 22, 2008 3:16 pm UTC
Location: Somewhere between Azeroth and Middle Earth

Re: Funniest/Most Annoying Code Comments

Postby LauraSakura » Fri Feb 22, 2008 3:40 pm UTC

I tend to not write enough comments =/
Usually because I have to turn them in for class... and well, I'd have the urge to write inappropriate things.

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

Re: Funniest/Most Annoying Code Comments

Postby btilly » Fri Feb 22, 2008 9:44 pm UTC

LauraSakura wrote:I tend to not write enough comments =/
Usually because I have to turn them in for class... and well, I'd have the urge to write inappropriate things.

Somehow I'm reminded of how Linus Torvalds met his wife. He was teaching an introduction to computers course. The homework exercise was to send the teacher an email. She sent him one asking him to go on a date. :wink:
Some of us exist to find out what can and can't be done.

Others exist to hold the beer.

User avatar
wing
the /b/slayer
Posts: 1876
Joined: Tue May 29, 2007 5:56 am UTC

Re: Funniest/Most Annoying Code Comments

Postby wing » Sun Feb 24, 2008 5:21 am UTC

Code: Select all

int x; //y coordinate
int y; //x coordinate


*FACEPALM*

The worst part: The comments are *RIGHT*
I AM A SEXY, SHOELESS GOD OF WAR!
Akula wrote:Our team has turned into this hate-fueled juggernaut of profit. It's goddamn wonderful.

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 » Sun Feb 24, 2008 5:40 am UTC

wing wrote:

Code: Select all

int x; //y coordinate
int y; //x coordinate


*FACEPALM*

The worst part: The comments are *RIGHT*


Wait... WHAT? *brain explodes* (though, at that point I'd bring up find/replace...)

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 » Sun Feb 24, 2008 1:29 pm UTC

wing wrote:

Code: Select all

int x; //y coordinate
int y; //x coordinate


*FACEPALM*

The worst part: The comments are *RIGHT*

If you have not yet stabbed the person that wrote that, go do it now. They have no right to be alive.
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
Vanguard
Posts: 807
Joined: Mon Nov 19, 2007 3:52 pm UTC
Location: Away from you

Re: Funniest/Most Annoying Code Comments

Postby Vanguard » Mon Feb 25, 2008 4:22 pm UTC

wing wrote:

Code: Select all

int x; //y coordinate
int y; //x coordinate


*FACEPALM*

The worst part: The comments are *RIGHT*


That's how math works these days. Is it any wonder why everyone hates it so much?
Image

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

Re: Funniest/Most Annoying Code Comments

Postby btilly » Mon Feb 25, 2008 7:56 pm UTC

wing wrote:

Code: Select all

int x; //y coordinate
int y; //x coordinate

*FACEPALM*

The worst part: The comments are *RIGHT*

Sadly I can see how that happened. It is very easy to get coordinates reversed. And if you've got it working then realized that the coordinates are reversed, the prospect of fixing the code can be more daunting than putting the comment in place.

Not that that gives me any sympathy, mind you. Because sometimes there is just a right thing to do, and this is one of those times.
Some of us exist to find out what can and can't be done.

Others exist to hold the beer.

Codephirst
Posts: 5
Joined: Wed Feb 13, 2008 12:14 am UTC

Re: Funniest/Most Annoying Code Comments

Postby Codephirst » Tue Feb 26, 2008 1:15 am UTC

btilly wrote:
wing wrote:

Code: Select all

int x; //y coordinate
int y; //x coordinate

*FACEPALM*

The worst part: The comments are *RIGHT*

Sadly I can see how that happened. It is very easy to get coordinates reversed. And if you've got it working then realized that the coordinates are reversed, the prospect of fixing the code can be more daunting than putting the comment in place.

Not that that gives me any sympathy, mind you. Because sometimes there is just a right thing to do, and this is one of those times.

Such is the beauty of automated code refactors.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 5 guests