In my not so humble opinion there's no excuse for leaving commented-out code in a release. During debugging you might want to comment-out areas of code to see what happens and that's fine. Then you might decide that you want to remove certain parts permanently but also that you should be able to restore the code if necessary. That's what version control is for. My rule of thumb is to NEVER check in anything which contains commented-out code, because that kind of stuff tends to build up over time.

As an example, on one fairly complex C++ project I worked on , two of the other coders not only commented away code but also had little conversations in the comments, like this...

... for ( i = 0; i < max; i++ ) { doSomething(); // I really think this part should be removed. /Stefan doSomethingElse(); // No, it shouldn't. /Björn } ... and even further down... // This code is strange. I fear it.
These guys shared the same room. Wouldn't it've been better if they'd talked to each other directly? :)

Cheers,
-- moodster


In reply to Re: Commented out production code? by moodster
in thread Commented out production code? by t'mo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.