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

Re: Python or Perl for a Debian maintainance project?

On Thu, Feb 19, 2004 at 05:00:31PM +0100, Matthias Urlichs wrote:
> Hi, Andrew Suffield wrote:
> > My criticisms were of using exceptions to avoid handling errors, which was
> > the proposed "advantage".
> Actually, I didn't say that at all. On the contrary, exceptions are there
> to _handle_ errors.

What you said was that it made the code shorter. I stipulate that, if
you handle the errors, it does no such thing.

Well-written code without using exceptions should be slightly shorter
than well-written code using exceptions. If you find that this is not
the case, then your code without exceptions is not good enough. (The
tradeoff of exceptions is worthwhile in the scenario I described
earlier - throwing errors to an unknown location that may or may not
understand how to handle them, such as across a library API).

The only way to get shorter is to not handle the errors - which is the
norm in python.


> Now try the same thing in Perl.

All the time. There's at least three entirely distinct approaches in
perl (which one is appropriate depends on what you're doing), unlike
python which attempts to force every scenario into one form. Otherwise
there's no difference. Getting perl to use the python syntax is not
hard (but getting "close enough" is trivial, and the rest of the way
isn't worth the effort).

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

Attachment: signature.asc
Description: Digital signature

Reply to: