in reply to Rambling about debuggers

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.