Design By Contract does not seem to solve the problem, it only makes language translator complain a little earlier, does it?
Yes, but nothing can solve that problem really, since its "user error". I forgot where I heard it, but I have always like the quote: "Complain early and often" when speaking about error handling.
We need to test the code with both correct and incorrect input values in any case.
I agree. My point is that you can efficiently create those tests using this style and not have the overhead of full blown conditional blocks.
In reply to Re^2: Being more Assert-ive with Perl
by stvn
in thread Being more Assert-ive with Perl
by stvn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |