comp.lang.ada
 help / color / mirror / Atom feed
From: brnstnd@kramden.acf.nyu.edu
Subject: Re: bug me now / bug me later
Date: 14 Jun 90 05:22:10 GMT	[thread overview]
Message-ID: <23471:Jun1405:22:1090@kramden.acf.nyu.edu> (raw)
In-Reply-To: 7498@fy.sei.cmu.edu

In article <7498@fy.sei.cmu.edu> firth@sei.cmu.edu (Robert Firth) writes:
> In article <811@sagpd1.UUCP> jharkins@sagpd1.UUCP (Jim Harkins) writes:
> >	a.	for(i = SIZE; i != 0; i -= STEP)
> >	b.	for(i = SIZE; i > 0; i -= STEP)
> First, the coding of the loop should have nothing to do with the values
> of SIZE and STEP.  The code you write should be determined by the
> postcondition you wish to establish.

Say what? Who cares what the value of i is after the loop? Most of the
time I want to see i uninitialized the moment the loop ends (though
there are enough exceptions to this rule that I don't want the language
to force it on me).

> Secondly, the question of errors.  If the loop variable reaches a state
> from which the postcondition is unreachable, there is an error in the
> code.

Again, who says there has to be a postcondition? The programmer is
thinking about the values i will take on trips through the loop, not
about the value it'll have afterwards.

---Dan

  reply	other threads:[~1990-06-14  5:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-06-07 23:26 bug me now / bug me later Jim Harkins
1990-06-08 16:51 ` Charles H. Sampson
1990-06-11 22:19 ` Wade Richards
1990-06-12 13:36 ` Robert Firth
1990-06-14  5:22   ` brnstnd [this message]
1990-06-14 15:00     ` David Kassover
replies disabled

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