From my perspective there isn't very much difference between using the debugger and sprinkling print statements through your code. In either case you're running your program in a way which gives you information about its internal state as it runs. The biggest difference is the level of interactivity: the debugger offers immediate access during a run but print statements require a new run to take affect.

I've used the debugger a few times, most often when I'm working on a program that takes a long time to get into a bad state. In this case the extra time needed to add a new print statement and get the result after a new run is too high.

Another good use is to figure out what your program is doing when it's locked up and you can't guess a good spot to put a print. The debugger can answer that question very quickly indeed!

-sam


In reply to Re: I never use the debugger. by samtregar
in thread I never use the debugger. by friedo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.