The Worst Comments

  • For questions about this code please call Francois at 6345789

    Changed code because customer wanted it

  • In a large assembly language - the comment "I have no idea what the next 2 lines do, but the program fails without them."

  • Stack Overflow did a bad comments thread two years ago at http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered. A friend on LiveJournal posted the following:

    #define TRUE FALSE

    //Happy debugging suckers

    // Replaces with spaces the braces in cases where braces in places cause stasis

    $str = str_replace(array("\{","\}")," ",$str);

    // drunk, fix later

    /**

    * Always returns true.

    */

    public boolean isAvailable() {

    return false;

    }

    .. and, of course...

    long long ago; /* in a galaxy far far away */

    I particularly love the last two. The SO thread is long since closed.

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

  • With the mitigation that a SQL Proc can only be simplified so far I'd say the need to comment inline with the code probably indicates that code should be refactored.

    comments such as BUG #455 should be in the source control comments for the code and infact many comments are probably more appropriate to source control that shows code as it was rather than active code which is code as it is.

    Valid comments are those written expressly to be picked up by Red-Gate SQLDoc or other documentation tools to provide people with a "Books online" type facility.

    The most entertaining comments (if you are into black humour) came in the Microsoft BizTalk database where there had clearly been a huge falling out between the developers and the DBAs making the BizTalk product. The gist of it was that DBAs, in the developers opinion, should never have a say in the design or maintainance of a database system. In fact the early Microsoft server products punished any DBA who tried to do anything other than backup the database.

    Anyone remember Microsoft Site server (silent H in Site)

  • The worst comment I've ever seen (as opposed to one I wrote) was in MS Access. The previous developer had written a lot of profanity-filled comments. Anyone who's worked with MS Access may know that when it hits an error it breaks to code....

    I was called into the boss's office to explain to him and the client why there were comments in the code swearing at the users.....

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (3/16/2015)


    The worst comment I've ever seen (as opposed to one I wrote) was in MS Access. The previous developer had written a lot of profanity-filled comments. Anyone who's worked with MS Access may know that when it hits an error it breaks to code....

    I was called into the boss's office to explain to him and the client why there were comments in the code swearing at the users.....

    Blaming a previous developer is one of the oldest tricks in the book ... and sometimes a very useful one.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil Parkin (3/16/2015)


    GilaMonster (3/16/2015)


    The worst comment I've ever seen (as opposed to one I wrote) was in MS Access. The previous developer had written a lot of profanity-filled comments. Anyone who's worked with MS Access may know that when it hits an error it breaks to code....

    I was called into the boss's office to explain to him and the client why there were comments in the code swearing at the users.....

    Blaming a previous developer is one of the oldest tricks in the book ... and sometimes a very useful one.

    Using source control evidence to disprove such deflection is the second oldest. Perhaps.

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • GilaMonster (3/16/2015)


    The worst comment I've ever seen (as opposed to one I wrote) was in MS Access. The previous developer had written a lot of profanity-filled comments. Anyone who's worked with MS Access may know that when it hits an error it breaks to code....

    I was called into the boss's office to explain to him and the client why there were comments in the code swearing at the users.....

    I have found it an extremely useful rule to follow: "Never say anything in a permanent medium that you aren't 100% sure you want on record." i.e. no gripes, no blaming and no unprofessional language. Certainly nothing personal.

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • Gary Varga (3/16/2015)


    Phil Parkin (3/16/2015)


    GilaMonster (3/16/2015)


    The worst comment I've ever seen (as opposed to one I wrote) was in MS Access. The previous developer had written a lot of profanity-filled comments. Anyone who's worked with MS Access may know that when it hits an error it breaks to code....

    I was called into the boss's office to explain to him and the client why there were comments in the code swearing at the users.....

    Blaming a previous developer is one of the oldest tricks in the book ... and sometimes a very useful one.

    Using source control evidence to disprove such deflection is the second oldest. Perhaps.

    Source control and MS Access don't go well together. The code is all in the mdb file, not separate files that source control can pick up and version track.

    In this case it really was a previous developer, one that had since left the company, and it was a part of the code base I hadn't looked at since taking the project over. Hence it was all my fault.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I recently came across comments when troubleshooting a program we have used for years that only used the month and day when dating the change. No year.

  • GilaMonster (3/16/2015)


    Gary Varga (3/16/2015)


    Phil Parkin (3/16/2015)


    GilaMonster (3/16/2015)


    The worst comment I've ever seen (as opposed to one I wrote) was in MS Access. The previous developer had written a lot of profanity-filled comments. Anyone who's worked with MS Access may know that when it hits an error it breaks to code....

    I was called into the boss's office to explain to him and the client why there were comments in the code swearing at the users.....

    Blaming a previous developer is one of the oldest tricks in the book ... and sometimes a very useful one.

    Using source control evidence to disprove such deflection is the second oldest. Perhaps.

    Source control and MS Access don't go well together. The code is all in the mdb file, not separate files that source control can pick up and version track.

    In this case it really was a previous developer, one that had since left the company, and it was a part of the code base I hadn't looked at since taking the project over. Hence it was all my fault.

    Sorry. I forgot. MS Access and I are old friends be he never sends flowers, calls, emails or even instant messages me...[sniff]

    ...and of course it was your fault as who else was there to visible shake down in front of the client!!! (Except perhaps the hiring manager or a dozen of other people who could have, given enough time, identified the issue with the previous developer or the issues that the previous developer was facing and dealt with them.)

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!

  • I actually saw this in a procedure on production.

    --My boss says I have to comment my code, so this is my comment

    Sigh.

  • I've seen comments where the writer bashed someone for forcing them to add the code.

  • GilaMonster (3/16/2015)


    Gary Varga (3/16/2015)


    Phil Parkin (3/16/2015)


    GilaMonster (3/16/2015)


    The worst comment I've ever seen (as opposed to one I wrote) was in MS Access. The previous developer had written a lot of profanity-filled comments. Anyone who's worked with MS Access may know that when it hits an error it breaks to code....

    I was called into the boss's office to explain to him and the client why there were comments in the code swearing at the users.....

    Blaming a previous developer is one of the oldest tricks in the book ... and sometimes a very useful one.

    Using source control evidence to disprove such deflection is the second oldest. Perhaps.

    Source control and MS Access don't go well together. The code is all in the mdb file, not separate files that source control can pick up and version track.

    Just tell them Access has a known bug called Tourettes. Use it as a justification to get off Access. 😀

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • GilaMonster (3/16/2015)


    The worst comment I've ever seen (as opposed to one I wrote) was in MS Access. The previous developer had written a lot of profanity-filled comments. Anyone who's worked with MS Access may know that when it hits an error it breaks to code....

    I was called into the boss's office to explain to him and the client why there were comments in the code swearing at the users.....

    We have a few users at my company that are able to create macros in Excel. There are a lot of interesting method and variable names in that code. Luckily for us, all those spreadsheets are for internal use only.



    The opinions expressed herein are strictly personal and do not necessarily reflect the views or policies of my employer.

Viewing 15 posts - 76 through 90 (of 156 total)

You must be logged in to reply to this topic. Login to reply