gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] using exceptions


From: Ian Haywood
Subject: Re: [Gnumed-devel] using exceptions
Date: Sun, 01 Jan 2006 09:13:37 +1100
User-agent: Debian Thunderbird 1.0.7 (X11/20051017)


Syan Tan wrote:
> 
> not sure if python has checked/unchecked exceptions ( probably not). 
> it's a little difficult understanding why
> 
[snip]
> 
> I suppose with runtime exceptions, there is no setup of an exception
> harness, so methods that don't
> throw exceptions run quicker.
AFAICT these issues don't relate to python, if anything it is slightly
faster to throw and catch and exception than to use "if".

Karsten's points where around a) using proper exception classes
rather than just a bare string (which is "old-fashioned" python)
and b) only throwing exceptions for real errors, both of wich I agree with.

You are right there is little point trying to catch "SyntaxError" for example.
which is try I would add that we shouldn't be using bare "except:" clauses,
but always spell out what errors we wish to catch
(which you must do in Java anyway)

Ian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]