SPUG: re:humble print statement for debugging

Michael R. Wolf MichaelRWolf at att.net
Wed Mar 24 13:28:55 CST 2004


"Marc M. Adkins" <Perl at doorways.org> writes:

> On Tuesday 23 March 2004 01:03 pm, Andrew Sweger wrote:
>> On Mon, 22 Mar 2004, Kristi Anderson wrote:
>> > I've just recently added perl to the list of languages of which I know
>> > just enough to be dangerous.  One thing I've noticed about all of them
>> > is that you can almost always easily figure out how to use print or
>> > show or display or printf or cout, but to learn the debugger of each
>> > is considerably more time consuming.
>>
>> But that time pays big dividends. Every person I have taught how to use
>> the Perl debugger has exclaimed how they could have saved so much more
>> time in the past had they known how to use it. Of course, the same can be
>> said for so many other time saving bits of knowledge too.
>
> I find that any new software environment presents a debugger-related learning 
> curve.  I tend to put off learning it until I think that the cost of getting 
> over the first hump of learning to build a debugger version and the 
> peculiarities of whatever debugger I'm using (it does WHAT?) will be offset 
> by time saved in solving the problem.  But them I'm just lazy.

Laziness -- one of the 3 virtues of a good programmer.

[...]

> I do have as an alternative a fairly powerful trace logging system.  In 
> addition to a flexible, low-overhead trace statement filter I use an output 
> stream that understands timestamps, message types, and indentation.  When 
> properly used, which is pretty simple, it presents a really clear picture of 
> code execution, especially with complex, recursive code.  In production it 
> allows filters to pull errors out of the log stream for summation, 
> notification, or display.

Hubris.  2 of 3.


> Perhaps it's the type of problems I solve with Perl.  Right now I'm processing 
> batches of 10,000 - 20,000 documents at a time.  The jobs run forever and 
> errors may occur in 2 minutes or 2 days.  So my only hope is really good 
> logging (i.e. trace statements).

Impatience.  3 of 3.


You qualify. Welcome to the club!!!


-- 
Michael R. Wolf
    All mammals learn by playing!
        MichaelRWolf at att.net





More information about the spug-list mailing list