I'm saying that if the input types to an algorithm are both type-checked & range-checked, then the ranges and types of the outputs will be consistant. There is no need to re-check those derived types and ranges. There is no need to check all possible permutations, only the boundary conditions--and thats a given.

We are (as usual) arguing past one another and talking about different things. Not worth trying to explain, suffice to say that I do not agree that removing checks at runtime is a good idea, no matter how many unit tests you have. Honestly, I rarely find myself writing code that can be tested in this way, most of my $work code is all messy with humanity and is not as clean as yours seems to be.

A challenge: Demonstrate otherwise?

No thanks, I have better things to do. Like I said, we are talking past one another anyway and clearly not speaking about the same things (which seems to be a pattern too, *sigh*)

You are suggesting that you need to protect against the possibility that someone will make modifications to production code to override methods at runtime. Why? So that you can tell them what they did wrong.

Nah, I was just using that as an extreme example, there is plenty of other stupid things that can be done in between here and there that would still break the assumptions I am talking about (but which are different from the ones your talking about since we are never on the same page here anyway).

I guess our undestanding of what constitutes "production code" varies.

No doubt, but does this really surprise you? At $work we maintain systems for a long time, constantly adding new data and features, fixing bugs, etc etc etc. Don't get me wrong, our production systems are solid and we have the customers to prove it, but I believe that code in todays world has to be fluid and flexible, able to adapt in the ever changing business landscape. And while I believe strongly in testing my software, I don't lean too heavily on that. Bugs happen, ARE YOU PREPARED!!! I know I am, because I have 30 quadrillion type checks in my poorly written OO ready to chew up all remaining disk space in one GIANT MONSTER of a stack trace!

-stvn

In reply to Re^11: OO automatic accessor generation by stvn
in thread OO automatic accessor generation by Neighbour

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.