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

Re: Python or Perl for a Debian maintainance project?

On Fri, Feb 20, 2004 at 09:42:52AM +0100, Matthias Urlichs wrote:
> Hi, Andrew Suffield wrote:
> >> therefore it's not all that well tested, and lots of little niggly
> >> difficult-to-reproduce bugs (reference counting, error reporting, et
> >> al.), still lurk in the corners when you do any kind of non-local exit.
> > 
> > That's frequently unrelated (exit would have the same problems). There are
> > some subtle issues with global destruction still in 5.8.
> > 
> Frankly I don't care THAT much about destructors running on exit.
> I do care about cleanup code, both in the exception and non- case.
> Perl's Error::Simple's "try FOO finally BAR" construct doesn't execute
> BAR if FOO simply calls exit(),

Don't do that, then.

> or is interrupted by ^C,

Install a SIGINT handler that throws an exception.

> or leaves by
> way of a non-local GOTO (which fortunately ;-) doesn't exist in Python,
> so that point isn't entirely fair).

Don't do that either.

> All of this doesn't change the fact that Perl code actually has to test
> for errors _all_the_time_ if it wants to be reliable -- it's very easy
> to overlook exactly the one call which will later bite you.  :-/

"It's very easy to write broken code".

Well, sure, but exceptions don't help. Only thinking while writing
code helps in a Turing-complete system.

It is no more correct to forget to handle the error with exceptions
than it is to forget to handle the error with regular return values.

  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'                          |
   `-             -><-          |

Attachment: signature.asc
Description: Digital signature

Reply to: