Bravo. I concur with every word.

The only addition I would make is that if I have to fix or modify a piece of shared ownership/corporate code that is in a style radically different from my own preferred, then I will often go through the same "re-write and rename to my style" process in order to get to know that piece of code--on a private copy.

Only once I am convinced that I understand what the code really does and it still passes any existing tests, will I attempt to fix or modify it. And once I have made and verified the changes, I'll go back to the original and attempt to re-make them, in the original style, minimizing the changed lines commensurate with doing the job right before check in.

80% (figure varies) of the life cost of a piece of code may be in the maintenance phase, but I've seen studies that put up to 50% of that 80% as backing out incorrectly fixed bugs; fixing introducd bugs; or the backing out of features added that broke existing code.

Hit & run maintenance costs. And the two primary causes are: 1) 'simple' changes made to 'simple' code that turns out not to be; 2) changes made on the basis of out-of-date comments. I suspect, but have never seen proof, that a third cause is attempting to minimise changes for the sake of VCS change history stats.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^2: Maintenance vs. Programming style by BrowserUk
in thread Maintenance vs. Programming style by apl

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.