Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I'm amazed at how many people "just add prints" when they need to debug. I believe this has to do with not wanting to take the time to learn how to use the debugger.

Even if you only want to "just add prints", then you can use the debugger to simply add prints dynamically.

And using Data::Dumper to debug? I find an interactive "x $obj" requires much less typing, gives me a chance to look at related data if $obj shows something interesting, lets me change $obj to test if a suspected bug fix will actually get the proper output (often allowing me to fix more than one bug in a single run), doesn't force me to either page through lots of debug output nor try multiple runs trying to get the debug output right, and on and on.

If you've never used the Perl debugger for debugging, I urge you to give it a try the next time you need to debug.

I guess I've been "blessed" by having to track down non-trivial bugs that would be horrible to find by just adding trace so I've always managed to learn how to use the debugger for most of the programming environments I work in for very long.

I just can't believe that the process of "Gee, which things should I print out in the debug trace..." or the effort of printing out "everything" and then slogging through the output is more appealing or more efficient than setting a break point at the place were you wanted the trace and then just typing "x $x,$y", "No, those look right", type "|x $obj", "Hmm, why is 'color' undefined?", etc.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: Are debuggers good? by tye
in thread How to debug unknown dynamic code? by gaspodethewonderdog

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (4)
    As of 2021-05-08 11:00 GMT
    Find Nodes?
      Voting Booth?
      Perl 7 will be out ...

      Results (96 votes). Check out past polls.