P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
No, you don't. Check-when-setting is to check-when-using as a compile time check is to a run time check. We want as much as possible of the former, so we get alerted when the problem happens, rather than hours later when any connection to its source is lost. What you describe, however, is a case of a stupid interface. The problem you described occurs when you want to set several parts of the data structure, but the steps are checked for validity separately. The answer is there needs to be a way to signal that a series of changes is atomic. In this case, if you are doing this in Perl, it can be achieved very easily by offering a method like
Designing good interfaces is hard but very fundamental. Makeshifts last the longest. In reply to Re^4: This is why I use Perl
by Aristotle
|
|