comp.lang.ada
 help / color / mirror / Atom feed
From: stephen@dino.dnsalias.com (Stephen J. Bevan)
Subject: Re: Ada exceptions. unchecked?
Date: Fri, 05 Jul 2002 14:35:23 GMT
Date: 2002-07-05T14:35:23+00:00	[thread overview]
Message-ID: <m3n0t6utsl.fsf@dino.dnsalias.com> (raw)
In-Reply-To: 3D08EF2D.6020406@mail.com

Hyman Rosen <hyrosen@mail.com> writes:
> Yes, the problem is that the program, or the programmer,
> needs to know what exceptions to handle, but not every
> routine needs to know it. It seems to me that this should
> be accomplished through documentation.

The Java designers decided that, like types, exceptions must be
statically checked by the compiler***.  They presumably did this for
the same reason that they want types statically checked: to catch as
many errors at compile time as possible (i.e. avoid an exception being
thrown for which there is no handler).

It is possible that they went too far with this and that statically
checking exceptions causes more pain than it is worth.  However, if
you ask a Smalltalk or Lisp programmer they'll tell you that
statically checking *types* (as is done in Ada) causes more pain than
it is worth it would be better to use documentation and/or test cases.

*** There is a loophole: RuntimeException (and any subclasses) can be
    thrown without listing it in a method signature.



  reply	other threads:[~2002-07-05 14:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-12  7:00 Ada exceptions. unchecked? steve_H
2002-06-12 13:52 ` Ted Dennison
2002-06-12 14:09 ` Larry Kilgallen
2002-06-12 13:47   ` Mark Johnson
2002-06-12 15:40     ` Larry Kilgallen
2002-06-12 16:07       ` Darren New
2002-06-12 22:21         ` Dale Stanbrough
2002-06-13 14:36           ` Hyman Rosen
2002-06-13 16:41             ` Darren New
2002-06-13 17:13               ` Hyman Rosen
2002-06-13 17:48                 ` Darren New
2002-06-13 18:06                   ` Hyman Rosen
2002-06-13 18:37                     ` Darren New
2002-06-13 19:14                       ` Hyman Rosen
2002-07-05 14:35                         ` Stephen J. Bevan [this message]
2002-06-12 19:25     ` Simon Wright
2002-06-12 22:19     ` Gisle Sælensminde
2002-06-13 14:27       ` Mark Johnson
2002-06-14 21:32         ` Gisle Sælensminde
2002-06-14 21:45           ` Darren New
2002-06-15 15:10           ` Simon Wright
2002-06-15 21:26             ` AG
2002-06-15 23:37               ` Darren New
2002-06-15 23:50                 ` AG
2002-06-15 23:57                   ` Darren New
2002-06-17 18:21             ` Charles Lindsey
2002-06-18 16:32             ` Stephen Leake
2002-06-18 19:48               ` Wes Groleau
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox