Welcome to the Monastery | |
PerlMonks |
Re^5: use Ensure -- module to spot undefined stuffby Fletch (Bishop) |
on Aug 06, 2008 at 17:18 UTC ( [id://702688]=note: print w/replies, xml ) | Need Help?? |
I think the main problem I have is that you're applying a static / strongly typed mindset ("the compiler should detect this problem beforehand") to a dynamic language. The reason it's a runtime error and not something strict prevents is because common idioms (AUTOLOAD, Perl's method dispatch mechanism) render static analysis of calls pointless because the answer can't be known in those (again, commonly used) cases until runtime (and even then the answer may change over any given run). The approach most dynamic languages encourage instead is to have ample tests which cover as much of your code base as possible (especially tests for the corner cases like the "little used part[s]"). Letting strict catch what can be reliably diagnosed statically, while depending on Devel::Cover and an autocompleting editor to guard against runtime problems, seems to me to be a better solution. But that's just me, of course. . .
The cake is a lie.
In Section
Code Catacombs
|
|