comp.lang.ada
 help / color / mirror / Atom feed
From: "chris.danx" <chris.danx@ntlworld.com>
Subject: Re: Questions on implementations and specs
Date: Fri, 12 Oct 2001 13:39:52 +0100
Date: 2001-10-12T13:39:52+01:00	[thread overview]
Message-ID: <gwBx7.2411$oE5.326974@news2-win.server.ntlworld.com> (raw)
In-Reply-To: slrn9sdhka.hnq.aidan@crushed.velvet.net


"Aidan Skinner" <aidan@velvet.net> wrote in message
news:slrn9sdhka.hnq.aidan@crushed.velvet.net...
> On Thu, 11 Oct 2001 18:03:41 +0100, chris.danx <chris.danx@ntlworld.com>
> wrote in <Ahkx7.4857$i14.643289@news2-win.server.ntlworld.com>:
>
> >  documented).  I was under the impression that the programmer should not
need
> >  to look at the implementation *in most cases* (of course there are
cases
> >  when we do need to look at the implementation).
>
> This is one of the areas where I like Java over Ada. The raises statement
> and it's enforcement by the compiler are, IMO, very very useful.

It might be nice to see some optional method of specifying exceptions that a
routine may generate (need not specify them all), like

name_error : exception;

procedure open (file : file_type)
   with exception (name_error, blah_blah);

but I think the Java 'must specify exceptions' is a pain mostly (even though
it helps with documenting exceptions).

> Being able to see clearly what each method/function/procedure can generate
> is a great help, although they should be documented by the package spec,
> it's not always...

There are a lot of implied exceptions (like constraint_error) which don't
need documentation but in some cases where a condition could arise that is
important and there is no alternative method to detect the condition, the
exception signalling the condition should be documented, IMO.



Chris




  reply	other threads:[~2001-10-12 12:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-11 17:03 Questions on implementations and specs chris.danx
2001-10-11 18:31 ` chris.danx
2001-10-11 22:39   ` chris.danx
2001-10-12 10:31 ` Aidan Skinner
2001-10-12 12:39   ` chris.danx [this message]
2001-10-12 16:43     ` Darren New
2001-10-14 13:41       ` Marc A. Criley
replies disabled

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