[Tutor] To error statement or not to error statement

Jim Mooney cybervigilante at gmail.com
Wed May 22 18:27:59 CEST 2013


>> "I find it amusing when novice programmers believe their main job is
>> preventing programs from crashing. ... More experienced programmers realize
>> that correct code is great, code that crashes could use improvement, but
>> incorrect code that doesn't crash is a horrible nightmare."

Then am I right to assume that rather than put in error statements I
barely understand at this point, the best thing would be to work the
hell out of the program in hope of seeing an error?  Does Python have
something that would do this automatically since I can't see running a
program a hundred times by hand?

Mainly, I'm just learning all this stuff for future reference. I
really doubt I'll need to use nose to find errors in twenty-line
programs. Print, assert, and staring at it for a long time should be
enough for now - and the Wing debugger now and then.

>From the varied replies so far, it sounds to me that debugging is more
of an art than a science. So far the books I've looked at just mention
the basics but don't get into the philosophy of when and how.

Jim


More information about the Tutor mailing list