The Industry choice
Roy Smith
roy at panix.com
Sun Jan 2 13:17:50 EST 2005
In article <cr99pd$rff$1 at panix3.panix.com>, aahz at pythoncraft.com (Aahz)
wrote:
> In article <xuTBd.66280$Jk5.42292 at lakeread01>,
> Steve Holden <steve at holdenweb.com> wrote:
> >Aahz wrote:
> >> In article <7xacrs230c.fsf at ruckus.brouhaha.com>,
> >> Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:
> >>>
> >>>I was pretty skeptical of Java's checked exceptions when I first used
> >>>them but have been coming around about them. There's just been too
> >>>many times when I wrote something in Python that crashed because some
> >>>lower-level function raised an exception that the upper level hadn't
> >>>been expecting, after the program had been in use for a while. I'd
> >>>sure rather find out about that at compile time.
> >>
> >> That's funny -- Bruce Eckel talks about how he used to love checked
> >> exceptions but has come to regard them as the horror that they are.
> >> I've learned to just write "throws Exception" at the declaration of
> >> every method.
> >
> >Pretty sloppy, though, no? And surely the important thing is to have a
> >broad handler, not a broad specification of raisable exceptions?
>
> Yes, it's sloppy, but I Don't Care. I'm trying to write usable code
> while learning a damnably under-documented Java library -- and I'm *not*
> a Java programmer in the first place, so I'm also fighting with the Java
> environment. Eventually I'll add in some better code.
The whole point of exceptions is that they get propagated automatically.
If I'm not going to catch it, why do I have to even know it exists? I
don't consider "throws Exception" to be sloppy, I consider it to be
programmers voting with their feet.
More information about the Python-list
mailing list