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: Jean-Christophe Filliatre <filliatr@l...>
Subject: Re: [Caml-list] Today's inflamatory opinion: exceptions are bad

 > >   # Use exceptions only for exceptional situations.

May be I've been misunderstood in my quote of Kernighan & Pike.
I simply think that there is no need to use exceptions when
"exceptional" cases are as frequent as "normal" ones. As others
already said, using option types is a good alternative. And the
efficiency is similar (it happens that I recently made a benchmark on
this particular point and I found out equivalent timings).

 > Even today, exceptions are used heavily in coq. Could you comment on
 > your experiences with the usage of caml exceptions in coq? Are
 > exceptions raised there "only for exceptional situations"?

The Coq proof assistant has been developed by many people and I only
contributed to a small part of it (mostly in the kernel). For this
part, at least, it is indeed true that exceptions are used only for
exceptional situations, mostly to signal typing errors. They are then
handled globally, at the top level of the system.

-- 
Jean-Christophe