I am suggesting--actually stating--that once classes have been properly unit tested, you only need verify parameters at the public/private interface.

The idea that you can unit test all possible inputs and all the possible permutations of their internal interactions, and that this is enough to ensure proper type usage, is just naive. It makes the assumption that the design will be frozen and especially in a language like Perl where a simple bit of anti-social code like *{BrowserUK::ClassFullOfAwesome::tested_method} = sub { ... } is possible, that is a bad assumption. This is not to say that in a disciplined shop where no one ever takes a shortcut due to an unrealistic deadline or idiotic business requirement this could not be true, but I have never heard of such a place. It has been my experience that when something that shouldn't happen happens, it is nice to have as much information as possible so that it can be reproduced and the whole plugged or bug squashed, retaining any and all type constraint checking in production means that I have all this information at my fingertips.

/me adds one more thing to his running list of "Things BrowserUK and I will never agree upon" ...

It called Design by Contract. Read Meyer and argue with him if you still disagree.

I like Meyer and have read him extensively, but he pretty much just talks about Eiffel and OO theory as it pertains to his idealistic Eiffel colored world. As for Design By Contract, I am not a huge fan, there are some good ideas but I much more prefer the type system of ML/Haskell. Of course the tradeoff is that polymorphism is much harder in ML and Haskell (Haskell typeclasses go a long way, but it's still not OO level polymorphism), but every language has it's pros and cons.

/me adds DoC and Meyer to the list now too ...

-stvn

In reply to Re^9: 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.