"We should not do this"



  • <FONT size=2>

    Found the following in a source file I was browsing today, and had to laugh.  The comment was inserted by the same developer who wrote the code, so:

    1) He knew it was bad

    2) He did it anyway...</FONT>

    <FONT color=#008000 size=2>// THIS IS A VERY BAD SOLUTION. WE SHOULD NOT DO THIS</FONT><FONT color=#008000 size=2>

    </FONT>


  • i have to admit i've done this more than once. i'll find a way to get something accomplished but put a LAME comment in to hopefully remind me to fix it...

    ...but for that to remain in production code is a serious wtf. why even put the comment in?



  • I've done that, too.  I think the biggest reason we do it is that we're trying to release ourselves from responsibility when "someone else" decides that the solution is good enough even when we disagree.  It's sort of like saying, "I did it, but only because my manager told me to."



  • This reminds me of one something dmr wrote about the advantages of the BUGS section in the UNIX manual. Sometimes he would catch himself writing a BUGS entry, and decide that it was just too embarrassing to document the bug, so instead, he would just go ahead and fix the underlying problem.




  • @Oscar L said:

    I've done that, too.  I think the biggest reason we do it is that we're trying to release ourselves from responsibility when "someone else" decides that the solution is good enough even when we disagree.  It's sort of like saying, "I did it, but only because my manager told me to."


    Yeah, I've been told off for that one, too.  I generally put them in for the benefit of anyone having to do maintenance, with a fullish description of what the root cause and fix are.

    "This code is highly inefficient, blah blah blah, the real problem is here but I've not been allowed to fix it"

    I nearly got sacked for putting a help button on a query panel that said something along the lines of "Fed up with this query taking 15 minutes to run?  Please escalate bug xyz so that management know it's important, maybe then we'll be allowed to fix it".  It was only on a beta release system, but management were not amused

    Simon



  • Maybe the developer was forced to implement the bad solution by a
    manager because finding a better one would have taken too much time...
    you know that sort of thing happens all the time.



  • Comments I've seen in other people's work:

    //this is not to be trusted

    //too much! fuzzy logic :(
    (with the actual sad smiley!)

    --------------------
    WTFish comments I've written:

    //NOOOOOO

    //CLEAN UP ISLE FIVE! CLEAN UP ISLE FIVE! (fortunately, removed when I removed the unnecessary line this referred to. The line trimmed a string of its \w)

    //This is convoluted crap. And I wrote it. Yay.
    (splitting an array's output into two html columns... without splitting the array. You know what. I'm going to rewrite that bit right now.)

    ////////AAAAAAAAAAARRRGHHH
    //what?
    //oh, hi.
    (checking for duplicates inside input fields.)

    I'm so proud of myself.



  • While I've seen (and probably made) my share of those comments as well, I prefer the "rage against the supplier" type of comments.  e.g.:

    //No need to pollute the test port with messages on [infrastructure]'s shortcomings
    // This is my fault for believing that [supplier code] would return a consistent value...

    Gotta love it!



  • @dhromed said:

    Comments I've seen in other people's work:

    //this is not to be trusted

    //too much! fuzzy logic :(
    (with the actual sad smiley!)

    --------------------
    WTFish comments I've written:

    //NOOOOOO

    //CLEAN UP ISLE FIVE! CLEAN UP ISLE FIVE! (fortunately, removed when I removed the unnecessary line this referred to. The line trimmed a string of its \w)

    //This is convoluted crap. And I wrote it. Yay.
    (splitting an array's output into two html columns... without splitting the array. You know what. I'm going to rewrite that bit right now.)

    ////////AAAAAAAAAAARRRGHHH
    //what?
    //oh, hi.
    (checking for duplicates inside input fields.)

    I'm so proud of myself.


    Haha!  Awesome!!!



  • A funny comments story I heard was from a company that had a contractor do a bunch of code and he laced the code with all these comments  about how horrible the client was.  Well, since the code was of such "fine" quality the client wanted to be given the code.  When the other developers where preparing to send the code to the client they found all the comments, but they were so pervasive they left them in.



  • I often put this in my code:

     

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

    *

    *

    *   I get paid by the line mutha-*****!!!!!

    *

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

     



  • My favorite comment:



    //I have no idea how/why this works, but it does





    Second favorite:



    //Found this on Google, it works



  • wrote


Log in to reply