If you need to change the code, patching it directly is the wrong thing to do. What happens if I don't override and instead patch? Many (probably most) programmers work for companies where testing is simply not done. I can say "just run your tests", but the reality is, I want to make things workable for people regardless of whether or not they run tests. There are also companies which have learned the value of testing but still have plenty of code which doesn't yet have tests. Again, the strategy of an external patch which breaks when it needs to is safer than a silent failure on upgrade. Also, I know plenty of people who couldn't patch XS code if it's the XS which is buggy.

As for waiting for a patch to be applied, that becomes problematic when working with code that hundreds of people use, many system administrators might or might notice and a bundle of programmers could possibly rely on. If I wait over a year for a patch but everyone who knows about this has left in the interim, having code mysteriously break on upgrade is far worse than having it clearly designed to break due to an external patch. I agree that Sub::Override is not an optimal solution, but I'm not always able to control when a module is going to get updated and in large companies, sometimes you need a better failsafe mechanism.

Cheers,
Ovid

New address of my CGI Course.


In reply to Re^2: Upgrade-proofing overridden subroutines by Ovid
in thread Upgrade-proofing overridden subroutines by Ovid

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.