• Randy Glenn (unregistered)

    Said two-week notice didn't have anything to do with this wonderful archive of WTFness, did it?

  • Ryan (unregistered)

    Useless comments suck, but I always feel bad not commenting, especially because I know the XML comments I make will become tooltips, but what more can you say about something like an "Email" property?

  • Jason (unregistered)

    Alex,
    Thats who my mortgage is through, so please do me a favor, and don't screw it up for me ;)
    Congrads.

  • RS (unregistered)

    Several years ago (circa 1988), I was consulting for a company with a rather “mature” programming staff (read as “the Jr. member of the team was in his mid 40’s and had been with the company for over 20 year”) and, hence, had some “mature” COBOL code. One of the programmers had the (good) habit of putting a comment in the “Remarks” section of the “Identification Division” every time he made a change. The bad part is that over years (decades?) of changing this program, the “Remarks” Section started to get pretty big.


    In the early 90’s, the Manufacturer of the company Mainframe planned to discontinue their Mainframe line and started to develop PC based tools to automate the transition to the Manufacturer’s other line of Mainframes. As the company I worked with was located near the R&D center that was developing the migration program, we were selected to test the tool. We sent a program from the above-mentioned programmer. I’m sure the developers of the migration program had a few WTF moments when their program crashed. I found it hard to believe that these developers did not consider that the “Remarks” section would contain 12,000 lines of comments. (tsk, tsk, tsk).

  • Aarrgghh (unregistered)

    I once interviewed at a software company in Boston, and they told me that a lot of their old code was kind of hard to figure out, because back in the 16-bit DOS days they decided to run it all through lint. Some of the files were big, and the 16-bit version of lint they had couldn't deal with files beyond some rather small arbitrary size -- smaller than 64k, whatever it was.

    So somebody figured maybe if they removed the comments, the files would be small enough. So they removed the comments. ALL of them. It worked!

  • Anon (unregistered)

    When you need a looping variable, you should name it i, j, k etc., right? Wrong, according to a co-worker. He used to just bash his hands on the keyboard to get some random chars and then copy'n'paste the variable name. "for (qpowdwqxo = 0; qpowdwqxo < 10; qpowdwqxo++" - sigh...

  • Simon (unregistered)

    I once found a comment in some old Cobol

    "Please don't touch this routine. I have no Idea how it works and I was drunk when I wrote it, but it does work"

  • Roger (unregistered)

    this one wasnt very funny..

    "// Summary: Call this method to remove all items in the list."
    would probably be pretty obvious if the class that contained it was named eg "UserCollection"

    i would then be pretty sure that that method would remove all users..

    (oke the last comment was a bit weird)

    i give it 0.5 WTF points...


    //Roger

  • Ray S (unregistered)

    Real men don't use comments. Actually, that's a lie.

    However I'm sure we've all come across the idiots who do such as this

    //declare x as an integer
    int x;
    ...
    //add 8 to x
    x = x + 7;

    to every single line of code. Especially where at some point down the line the comment and code got out of sync.

    I'm yet to decide what's worse - reams of completely useless comments (normally out of date) or no comments at all. Tough choice.

  • cablito (unregistered)

    I vote for no comments.

    I mean, if a real programmer sets an eye at a source code, he must be able to understand it, assuming of course the most basic programming standards were used. No need for type declaration on variable names either... like st_name for string or whatever...

    gHdc = GetDC(FindIDEWindow("Video"))

    this needs commenting?

  • Mark H. (unregistered)

    Remember, however, that what is obvious to some is not to others. Many times I've come across code that has not been commented because, as the developer said, "It clearly does...". Over-commenting is sometimes annoying, but always safe.

    RemoveAllItems clearly removes all items. But does it delete the associated data? Does it simply clear the list? Does it notify anyone? If anything, the comments are useless because they lack in detail.

  • Tim Smith (unregistered)

    It is easy to find silly examples of poor comments and use those as justification of not doing your job.

    1) You aren't as good of a programmer as you think you are.
    2) Your have a great ability to produce short an convoluted code.
    3) Your code documents itself as well as a Jr. high school bad plays Wagner's "Ring of the Nibelung".
    4) Just because there exists poor comments in no way implies that comments are bad. If you actually think that is the case, then you grasp on logic is so poor that you are probably the one "real" programmers laugh at when they have to fix your code.

    In other words, you suck as a programmer so don't make me have to figure out what your drunken mind meant by doing the silly things you do.

  • Shawn (unregistered)

    I worked with a programmer once who refused to comment anything. He said if it was hard to write it should be hard to understand. His code was hard to understand too. Mostly because it sucked.

  • Andy (unregistered)

    Aarrgghh said:
    "So somebody figured maybe if they removed the comments, the files would be small enough. So they removed the comments. ALL of them. It worked!"

    I can top that. At a previous job, we worked with an unstable version of Oracle Forms (bastard child of SQL, Pascal, and VB) for a while. After a bit, we discovered that if your source file was too long, Forms wouldn't compile it. So, our largest and most complicated pieces of code lost not only all their comments, but all their whitespace as well.

  • Katrina (unregistered)

    Congrats on the new job!

  • Distilled Software Hate (unregistered)

    When we used to write code in Microsoft or Apple Basic (either Microsoft's Applesoft or Wozniak's Integer Basic), we removed all the comments and spaces (except for the ones the detokeniser regenerated), put all frequently used constants in 1 or 2 letter variables because they were tokenised, moved all the frequently used subroutines to the beginning of the file because Basic did a linear search of line numbers, and then joined as many lines as possible together with ":" (statement separators) because not only did it make the linear search for line numbers faster, it avoided the need to add gotos because "if-then" skipped to the next line, not the next statement, if it was false.

    1 GOTO 1000
    2 A(II) = IJ + X1 : RETURN
    3 V = SIN(TH) + X2 * COS(TH)
    ...
    100 REM MAIN PROGRAM
    101 BLAH : BLAH : GOSUB 1 : BLAH
    102 IF SOMETHING THEN : LOTS : OF : STATEMENTS : GOSUB 3
    ...
    1000 REM INITIALISE
    1001 X1=1 : X2 = 2 : ...
    1002 GOTO 100

  • S. Stremler (unregistered)

    Comments are there to document /intent/. It took a long time for me to learn that.

    Back when I was a wee lad, just learning FTN IV, I rejoiced in blocking my comments in a variety of (nested) character-blocks, all very pretty, but basically useless.

    Stuff like:

    C ################################################
    C # SOME SECTION NAME #
    C # ============================================ #
    C # FUNCTION NAME #
    C # ============================================ #
    C # SOME GENERAL FUNCTION DESCRIPTION PROSE #
    C # THAT MIGHT SPAN A FEW LINES #
    C # #
    C # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #
    C # ! PARAMETERS ! #
    C # ! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ! #
    C # ! @ PARAMETERS @ ! #
    C # ! @ PARAM1 NAME @ ! #
    C # ! @ DESCRIPTION OF PARAM1 @ ! #
    C # ! @ PARAM2 NAME @ ! #
    C # ! @ DESCRIPTION OF PARAM2 @ ! #
    C # ! @ ETC... @ ! #
    C # ! @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ! #
    C # ! **************************************** ! #
    C # ! * RETURN VALUE * ! #
    C # ! * DESCRIPTION OF RETURN VALUE * ! #
    C # ! **************************************** ! #
    C # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #
    C ################################################
    <procedure starts here>


    All this was done with a line-editor, as we didn't have powerful programming editors available to us. (Vi? What, you think this was a UNIX box? And Emacs? There wasn't enough RAM in this machines to think about loading Emacs, much less processor power to RUN, especially with 100 time-sharing users online at once.)

    Yah, I had points taken off, which was unfair when the professor said "Comments can never hurt you, they can only help you." ... but probably a good thing for me. Some lessons come hard to a smart-aleck.

    It's not until I started trying to maintain code that I came to appreciate good comments, and to despise the idea that code is "self-documenting".

  • (cs)

    Hi, other people reading comments on extremely old posts! Those comments look sadly hand-generated, which is depressing. Someone on my team, on the other hand, has decided that everything should have comments, but not necessarily useful ones, so he has a tool autogenerate comments for anything lacking them. Which leads to such great comments as:

    ///

    /// Datas the grid view cell value changed. /// protected abstract void DataGridViewCellValueChangedCore(DataGridViewCellEventArgs e);

    Or...

    ///

    /// Gets or sets the content of the additional. /// /// <value>The content of the additional.</value> public string AdditionalContent {...}

  • TheCPUWizard (unregistered)

    A reply to an old comment that is not nearly as old as the thread itself...

    XML comments are primarily for usage OUTSIDE the codebase. On the specific comment by neminem, it looks like someone was just being lazy and not reviewing the comments (this is a part of code review!). The mangling he mentions is when a method name does not take the from of a verb...

Leave a comment on “When Comments go Wild”

Log In or post as a guest

Replying to comment #:

« Return to Article