On Friday 14 August 2009 07:21:00 Uri Guttman wrote:
> >>>>> "SB" == Steve Bertrand <st...@ibctech.ca> writes:
>   >> i don't use it but i know plenty who do and it seems to be a good
>   >> idea. i would recommend it for most perl hackers and if you want to
>   >> enforce a known set of coding styles. i strongly enforce my own style
>   >> as i edit so i don't generally need an outside agent. but then i don't
>   >> like or need syntax highlighting or use debuggers other than print.
>
>   SB> Interesting. So, print is a debugging tool that does a complete full
>   SB> circle. Many on the list have helped me with using different debug
>   SB> techniques which have greatly helped me advance my understanding of
> what SB> my code is actually doing. I appreciate what you say in your last
> SB> paragraph, and although have questions, I don't think I need to ask
> them.
>
> i started with punch cards. print was all you had besides thorough and
> deep analysis of your code. that is a talent lost on too many coders
> today. and even today proper use of print is better than any debug
> tool. but it is still a skill to learn, where and what to print and how
> to analyze the results. i have seen many good coders not get that and
> they stick with debuggers. i find the simplicity of print and my total
> control of what gets printed, etc better than learning more commands,
> having to repeat a set of debug commands (yes, you can macro and preset
> them but that is still more work), etc. print is always there in any
> programs (and debuggers have issues with complex sets of processes, and
> daemons and such).
>

My recent impression of most Perl programmers has been the opposite - most of 
them have been too lazy or unmotivated to learn about the perl -d flag (or 
similar interactive debuggers), and are always using print's or going on IRC 
asking "What is wrong with this code?" I find the perl debugger an 
indispensable tool and am actively using it.

While print's have their rightful place, I still think the perl debugger is 
too under-used.

BTW, you may wish to look at my Devel-LineTrace module as a replacement for 
print's:

http://search.cpan.org/dist/Devel-LineTrace/

It allows one to assign print's and other arbitrary debugging code into 
arbitrary locations in the code, without having to directly modify it. Thus, 
one doesn't have to get rid of the print's after one is done with debugging.

I wrote by inspiration from some discussion on Perl-Israel (first in a meeting 
and then on the mailing list). Lately, I've been mostly too lazy to use it and 
just inserted print's directly, but you may fare better with it.

Regards,

        Shlomi Fish

> uri

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/

God gave us two eyes and ten fingers so we will type five times as much as we
read.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to