From: Jean-Pierre Rosen on
Maciej Sobczak a �crit :
> This example uses rendezvous.
> I don't like it, because it misuses exceptions for something that is a
> perfectly normal control flow.
> Yes, this is very subjective - for the record, I also don't like the
> End_Error exception.
>
> BTW - the fact that you raise an exception only to shut it up in the
> same scope indicates that this is a severe misuse of some language
> feature.
>
This is a very restrictive (although widely shared) view of exceptions,
where you consider that they are only for signaling failures.

Exceptions are a programming tool for handling situations that are
"exceptions" to the regular processing. This is the case for errors of
course, but end of processing is perfectly appropriate.

Moreover, using exceptions in this case has the benefit that the worker
cannot ignore the signal (as would be the case with an out parameter).
If the exception is not handled, the worker will crash, but not block
the system.

--
---------------------------------------------------------
J-P. Rosen (rosen(a)adalog.fr)
Visit Adalog's web site at http://www.adalog.fr
First  |  Prev  | 
Pages: 1 2 3 4
Prev: Using GtkAda in Ubuntu
Next: gnat on opensuse 11.1