Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

In my opinion, when a program is constructed in such a very “dynamic” way (for what purpose?   “efficiency?”), it becomes utterly impossible to test it.   It becomes, in effect, many different possible programs, depending on (as you say) “how it is called.”   This practice is completely unacceptable to me, due to the inherent business risk.

In my experience, most such programs can be, perhaps with some effort, “de-fused” into one or more modules of common-code which can then be used by the specific in-house script that invokes them.   These scripts ought not attempt to make any decisions as to what code they do or do not invoke, and they should universally use use to do so.   (This is not, of course, an impregnable requirement, but IMHO it is very nearly so.   Obvious exceptions such as RPC::Any::Server are also very-limited in what they do and how they do it, and the required modules are also clearly “top-level handlers,” effectively selecting among possible scripts to call; not the case here.)

Any piece of software that is in service needs to be buttressed by independent, automated tests that can demonstrate that, in every case which that piece of software supports, the software works correctly.   If what the piece of software is composed of is subject to variation, that becomes pragmatically impossible to do.   What a group of scripts have in common, reasonably should be in-common, so that the common pieces can be tested and the tests will cover all of that code’s users.   If thereby the program contains code that it does not make use of in the course of any particular invocation ... who cares.   Such is of no consequence.

In reply to Re: subroutine good practise by sundialsvc4
in thread subroutine good practise by Anonymous Monk

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (1)
    As of 2018-04-24 05:58 GMT
    Find Nodes?
      Voting Booth?