your favorite debugging tool?

Ben Finney ben+python at benfinney.id.au
Tue Aug 25 16:49:56 CEST 2009


Esmail <ebonak at hotmail.com> writes:

> Hi Ben,
>
> Ben Finney wrote:
> >
> > Whenever a simple output statement is too cumbersome for debugging, I
> > take it as a sign that the program is too cumbersome to follow.
>
> I'll have to think about this .. though my gut says this is true :-)

Note that it's only a sign, *not* an ironclad guarantee. But it's the
right way to bet, IME.

> re your other point about the interactive shell, I agree it's useful,
> but to me still doesn't quite do what a full-fledged debugger can -
> but perhaps that is a reflection of my skill with the shell at this
> point.

This, on the other hand, I find even more consistent: if the code can't
be effectively inspected from the interactive interpreter, that's a sure
sign that its external interfaces are poor or its internal dependencies
too tightly coupled; or more likely both.

Fixing that set of problems is both useful for debugging *and* good
design.

-- 
 \         “Alternative explanations are always welcome in science, if |
  `\   they are better and explain more. Alternative explanations that |
_o__) explain nothing are not welcome.” —Victor J. Stenger, 2001-11-05 |
Ben Finney



More information about the Python-list mailing list