On Thursday 04 September 2008 10:50:37 David Cantrell wrote:
> Maybe I should start being equally loud and obnoxious about obviously
> stupid and broken things like the existence of UNIVERSAL-isa. It might
> give you some appreciation for how you're coming across here.
UNIVERSAL::isa and UNIVERSAL::can are examples of applying the design
principle of Report Bugs Where They Are, Not Where They Appear.
(Anyone who's debugged memory corruption problems in C or C++ should recognize
this principle.)
I've received far too many bug report for Test::MockObject where other code
elsewhere used methods as functions to perform type checking. I don't have
the time, nor power, nor inclination to file the appropriate bugs for all of
the CPAN, much less the DarkPAN, nor wait for fixes to all of those bugs and
upgrades to all of the appropriate distributions.
Thus, U::i and U::c work around the problem by detecting the failure
condition, revising it to work correctly, and reporting the bug at its point
of origin. (Earlier versions had one tremendous flaw in that they reported
all *potential* failures, rather than actual actionable failures explicitly
worked around. This was a huge mistake to which I clung to stubbornly for
far too long, and I've corrected it in recent versions. However good my
intentions in maintaining that feature, the effects worked against my goals.)
Hiding bugs doesn't get bugs fixed. It only multiplies hacky workarounds.
(Yes, U::i and U::c are hacky workarounds I'd love never to have to use.)
Adding an extra step to the bug triaging and reporting process doesn't get
bugs fixed either.
*That* is why I consider this philosophy important. It's a question of
spending limited time and resources where they're most effective.
As an aside, I'm open to the idea of loading U::i and U::c from T::MO only
when people request a debugging mode, such as:
use Test::MockObject ':debug';
... but my concern is that no matter how well I document the idea that if
T::MO and T::MO::E appear not to work correctly and that there may be
method-as-function bugs causing the problem, I'll again get a flurry of bug
reports that I'll have to shunt to other distributions. More likely, they'll
linger in a mail folder for a while and I'll delete them, months later. I am
*not* the person you want reporting bugs that don't affect me. Attempts to
make them affect me do not work. That's just how my brain works.
-- c