<?xml version="1.0" encoding="windows-1252"?>
<node id="48579" title="Re: Are debuggers good?" created="2000-12-28 01:14:46" updated="2005-08-12 09:45:10">
<type id="11">
note</type>
<author id="9073">
merlyn</author>
<data>
<field name="doctext">
I'm not into debugging.  I can't recall &lt;b&gt;ever&lt;/b&gt; invoking the Perl debugger except to try out snippets of code at a prompt (for which I type &lt;code&gt;perl -dead&lt;/code&gt; usually), or in class while I'm trying to teach the debugger (which I do poorly, since I don't "debug" my code with a debugger). But never for debugging.  (Larry is also like this, I'm told.)
&lt;p&gt;
So the question is, what do I use to debug?
&lt;p&gt;
Well, the first answer (and most important answer) is that I don't have to debug what doesn't contain bugs.  Don't put bugs in.  That's easier than it sounds, if you code in small chunks, slowly adding code one understandable step at a time.  Never type anything into a program if you can't completely run it in your head.
&lt;p&gt;
The second part of the answer is that I started programming long before we had all these fancy GUIs and drag-n-drool debuggers.  So when I had code go off the deep end, all I could do is keep adding &lt;tt&gt;print&lt;/tt&gt; statements until it worked.  As I got better, the number of &lt;tt&gt;print&lt;/tt&gt;s got smaller, and then eventually I could just code the whole thing without adding any debugging.
&lt;p&gt;
With Perl, I throw in a random "die", sometimes with the result of &lt;tt&gt;Data::Dumper::Dumper&lt;/tt&gt; in its mouth, but that's usually only once every five or ten times as I extend the program.
&lt;p&gt;
So what's all this about a Perl debugger?  Why do people use it? Have they not learned the more effective ways of never letting your code get ahead of you, and trying to reduce the problem to something a &lt;tt&gt;die&lt;/tt&gt; can show you?  I'm truly puzzled.

&lt;p&gt;-- &lt;a href="http://www.stonehenge.com/merlyn/"&gt;Randal L. Schwartz, Perl hacker&lt;/a&gt;&lt;/p&gt;</field>
<field name="root_node">
48474</field>
<field name="parent_node">
48495</field>
</data>
</node>
