On 10 May 01, at 11:16, Marjolein Katsma wrote:
> Debuggers are a wonderful invention - and I use them. But you don't
> need them (need to *pay* for them!) until you've exhausted all
> possibilities of displaying traces and variable values of your program
> while it's executing. With Perl on Win - that's just what you need
> your command-line window for: without it (or a debugger): how do you
> know what's happening?
my 2c (pretty useless AUDs but...):
i would have to disagree pretty whole-heartedly with that (in the
most friendly, constructive way i can manage :).
I think almost the opposite attack should be tried. learn to use the
debugger and use that first. if you can't get the debugger to give
the information you require, THEN put in trace statements etc.
the debugger has the wonderful benefit of not requiring any extra
code to run, no modifications to code, no extra errors and no weird
side effects. well almost. also, you can watch variables and
expressions that seemed obvious when writing the code but now
mysteriously don't work...
a nice tip i read somewhere, was to always run the code through
the debugger the first few times you run it (literally) to make sure it
does what you think.
very rarely do you spend hours on a problem when you point the
debugger at it first.
admittedly debuggers used to be too hard to use and way too
much effort (gdb anyone?). but the current crop of visual debuggers
are fantastic (eg VC++). the debugger in the activestate PDK is
well worth the download, and seems to work for a fair while without
costing anything :).
- Tom
(who wishes he'd learnt how to use the debugger -- and there'd
been decent debuggers -- before he learnt to program, it would have
saved me year's by now...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tompaton (at) connect (dot) net (dot) au
http ... people.connect.net.au/~tompaton