Interesting meditation.

I agree that the ease of use of the debugger affects how you program, but IMHO, that ease of use is subject to how familiar and skilled you are with the debugger in question. As I wrote in a recent post, I am very familiar with the perl command line debugger, and I tend to throw code at something and use the debugger to see if it did what I wanted. For me it is other languages where I find the debugger harder to use, and as a consequence do less hacking and debugging, and more thought.

One debug feature I miss though is the way Java debuggers will use the toString() method on an object to summarize it. Many years ago, I was working on a Java project using Eclipse. I noticed that in the Eclipse debugger if you hovered the mouse over a variable, it would use the toString() method on that variable to show you the contents. Obviously this is the correct thing to do for objects that can trivially be converted to strings, but I found that it helped to add the method to all of my own classes so that I could quickly see a summary of any object.

This is a feature I would like to see in Perl. Sometimes it is enough so see the contents of the blessed has that is a class instance, but often there is too much detail. It would be nice if there was a standard way for a perl class to provide a method to view an object, and if all perl debuggers would use that method by default to view the object.

In reply to Re: Rambling about debuggers by chrestomanci
in thread Rambling about debuggers by zek152

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.