On Tue, Apr 07, 2009 at 03:48:02PM +0100, Lyle wrote:

> I'm putting together some more Perl course material. One thing I see 
> listed in the content of a lot of Perl courses in the Perl debugger. Now 
> I'll be honest. I've never actually used the Perl debugger.
> 
> How popular is it? Have I been missing something vital, or is it only 
> good for small scripts and not big projects?

I've never used it either.  Well, not for anything more than using it to
see what it was like.  I do use Devel::Trace quite a bit though, and
liberally scatter print() statements around my code.  I also have some
code that I really ought to get round to uploading to the CPAN that logs
the input and output from functions, nicely formatting the output so you
can get a very clear idea of which functions call which functions, how
often they get called, where you recurse, and so on.

I try to test my code very frequently, rarely writing more than twenty
lines or so in between each run of the test suite, and I also *try* to
write tests for all the non-trivial functions in an application (not so
much in an individual CPAN module), even the private ones.  This means
that:
  * I can quickly zoom in on where the new bug is (it's in the 20 lines
    of code I just wrote);
  * I can be reasonably sure it's not in the functions that code calls
    (because they pass their tests)

Of course, I can still get bitten by "spooky action at a distance"
through things like global variables, accidentally trampling over
namespaces and by being insufficiently rigourous in testing those other
functions, but even so, it's rarely hard to find a bug in my perl code.
I spend far more time untangling messes I make when I misunderstand how
to use other peoples' libraries, or the protocol I'm meant to use to
talk to other applications, etc

-- 
David Cantrell | Minister for Arbitrary Justice

    If you have received this email in error, please add some nutmeg
    and egg whites, whisk, and place in a warm oven for 40 minutes.
_______________________________________________
BristolBathPM mailing list
[email protected]
http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm

Reply via email to