On Friday 14 August 2009 16:18:38 Shawn H. Corey wrote:
> Shlomi Fish wrote:
> > 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.
>
> "We will encourage you to develop the three great virtues of a
> programmer: laziness, impatience, and hubris." -- Larry Wall
> from http://www.c2.com/cgi/wiki?LazinessImpatienceHubris
>
> The last time I used a debugger was on a large C project.  For small
> programs and unit testing, it was fine, but when things went over 2000
> lines, it became increasingly frustrating to use.  Of course, print
> statements have their limits too but it happens at about 5000 lines.

According to SLOCCount by David A. Wheeler, for Freecell Solver's 
trunk/fc-solve/source :

{{{{{{{{{{{{{{
Totals grouped by language (dominant language first):
ansic:        16832 (80.85%)
perl:          2914 (14.00%)
python:         446 (2.14%)
sh:             354 (1.70%)
ruby:           274 (1.32%)

Total Physical Source Lines of Code (SLOC)                = 20,820

}}}}}}}}}}}}}}

I've successfully used gdb on this application, and I used it in the past, 
before I heavily refactored and trimmed it lately. Granted, it's an almost 
pure ANSI C program that doesn't do a lot of system stuff, but it is still 
pretty complex and pedantic. I've also used gdb on the GIMP and Subversion, 
which are much larger than Freecell Solver. In Subversion I ran into a (yet 
another) gdb bug, but they are otherwise OK.

I'm using debuggers simply because I know it's often faster and quicker to use 
them than to use traces. I'm not saying traces don't have their place, but 
debuggers are often time saving.

I also wrote some gdb scripts:

http://www.mail-archive.com/linux...@cs.huji.ac.il/msg54660.html

Regards,

        Shlomi Fish

>
> I use Data::Dumper a lot, so most of my debugging statements have
> "Dumper" in them, making them easy to find.  For those that don't, I add
> "# TEMPORARY" at the end.  And I leave them behind; I just put a "#" in
> front of them. :)

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Stop Using MSIE - http://www.shlomifish.org/no-ie/

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