Matt,
However, I would like to call peoples attention to a very interesting module I saw pop up on CPAN today.
http://search.cpan.org/~trey/Commands-Guarded/
It has an interesting declarative twist to it which I very much like,
and being the paranoid and (sometimes overly) defensive programmer that
I am I really like the whole idea of guarded commands.
Well, any module whose documentation discusses idempotence gets my vote. :-)
You know, they have pills for that now ;-)
What I understand from this module is that 'ensure' defines postconditions and 'sanity' defines invariants. How about a precondition block?
I agree, I was looking at the sanity block as doing that, but upon closer inspection, you are right, being an invariant checker it wont function well for proper pre-condition checking since the pre-condition need not be (and usually wont be) the same after the block is run.
BTW - terrence ([EMAIL PROTECTED]) has invited the author of that module to the list too.
Incidentally, 'ensure'- and 'sanity'-block size looks like it might be a useful metric for figuring out whether a particular subroutine is too complex. If you don't want to fill out that 'ensure' block because you know it's going to be a beast, maybe you're trying to do too much in one place.
This is actually an excellent idea for just a code metrics tool in general. Something which would loop through your packages and count the code size for each subroutine. Hmm, I wonder if anyone has already written it. Maybe during my next conf call I will check CPAN ;-)
Thanks for setting this up, Steve.
Not a problem Matt, thanks for joining (although metaperl did all the actual work).
Steve
_______________________________________________ sw-design mailing list [EMAIL PROTECTED] http://metaperl.com/cgi-bin/mailman/listinfo/sw-design
