comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: End of File for streams
Date: 2000/04/18
Date: 2000-04-18T00:00:00+00:00	[thread overview]
Message-ID: <8dgknk$b81$1@nnrp1.deja.com> (raw)
In-Reply-To: 8dg55l$us3$1@trog.dera.gov.uk

In article <8dg55l$us3$1@trog.dera.gov.uk>,
  "Kevin Rigotti" <rigotti@atc.dera.gov.uk> wrote:
> OK, its nice to have some external confirmation occasionally.
I don't get to
> see much code written by other people here ...
>
> In my own defence (but thanks Brian)
> 1) as an impressionable undergrad I was brought up on a diet
of functional
> programming so using exceptions for control flow seems
decadent :-)
>
> 2) I don't like using exceptions for non-exceptional behavior.
Just a
> personal foible.


You need to have the right view of what non-exceptional
behavior means.

For the loop doing the reading, the EOF *is* an exceptional
case, since the read fails.

At one level of abstraction higher, this is not an exceptional
situation, which is why we handle it locally at the lower
level of abstraction, and then do not propagate the exception
to a higher level.


Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~2000-04-18  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-17  0:00 End of File for streams Kevin Rigotti
2000-04-17  0:00 ` Gautier
2000-04-18  0:00   ` Kevin Rigotti
2000-04-17  0:00     ` Robert I. Eachus
2000-04-18  0:00     ` Jean-Pierre Rosen
2000-04-18  0:00       ` Brian Rogoff
2000-04-18  0:00         ` Jean-Pierre Rosen
2000-04-19  0:00           ` Brian Rogoff
2000-04-18  0:00     ` Robert Dewar [this message]
2000-04-17  0:00 ` Robert Dewar
2000-04-17  0:00   ` Brian Rogoff
2000-04-17  0:00 ` Gautier
replies disabled

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