Evaluating python - a question
Christian Tanzer
tanzer at swing.co.at
Sun May 20 09:53:55 EDT 2001
David Bolen <db3l at fitlinxx.com> wrote:
> tanzer at swing.co.at (Christian Tanzer) writes:
>
> > The problem are typos that are triggered rarely (e.g., in an exception
> > handler) -- you may correct the typo in 1 minute but your customer
> > might not be amused by seeing a stacktrace.
> >
> > As others already pointed out, unit-tests are the answer (and will
> > catch a lot more bugs than static type checking, too).
>
> In addition to unit tests, the fact that in production code you can
> establish an exception handler of last resort (or multiple
> intermediate such handlers) to record all traceback information (and
> with introspection, perhaps a bunch of your internal state), and then
> attempt a graceful recovery from a high level is very useful.
>
> Sure, sometimes you have to start over at a high enough level that
> something is lost for the user, but there's really normally no reason
> for the user to have to see a stacktrace - but if they send you the
> diagnostic dump you can get an immediate pinpoint to the problem area.
Well, my applications use a catch-all exception handler -- better to
keep the game going after my code messed up. But of course the user
still has to see the traceback in one form or another if I want to get
enough information to pinpoint the bug.
As I started using unit tests only after some years of busy
development, the catch-all handler is still exercised from time to
time.
--
Christian Tanzer tanzer at swing.co.at
Glasauergasse 32 Tel: +43 1 876 62 36
A-1130 Vienna, Austria Fax: +43 1 877 66 92
More information about the Python-list
mailing list