Version française
Home     About     Download     Resources     Contact us    
Browse thread
Today's inflamatory opinion: exceptions are bad
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris King <colanderman@g...>
Subject: Re: [Caml-list] Today's inflamatory opinion: exceptions are bad
On 12/10/06, Richard Jones <rich@annexia.org> wrote:
> On Sat, Dec 09, 2006 at 10:35:56PM -0500, Chris King wrote:
> > One thing Java (sort of) gets right is keeping track of which
> > exceptions a function can throw, making it easy to ensure that some
> > deeply nested piece of code won't cause the entire application to die
> > from some obscure exception.  I'd love to see a similar feature in
> > O'Caml, whereby the exceptions which a function can raise are part of
> > its type and are inferred and checked by the compiler.
>
> Oh please no!  Checked exceptions are the dumbest and most frustrating
> feature of Java (and that's saying something - the Java language has
> far more frustrations than most programming languages).

I fully agree.  Forcing the programmer to acknowledge the presence of
every possible exception is annoying to write and makes for fragile
code.  Hence I suggested exception inference... no extra effort is
required on the part of the programmer and the code is not made
fragile.  O'Caml provides the safety of checked types without the
hassle of type declarations; in the same way it could provide the
safety of checked exceptions without the hassle of exception
declarations.

- Chris