comp.lang.ada
 help / color / mirror / Atom feed
From: ian@rsd.bel.alcatel.be (Ian Ward)
Subject: Re: next "big" language?? (disagree)
Date: 1996/06/11
Date: 1996-06-11T00:00:00+00:00	[thread overview]
Message-ID: <4pk88b$hfs@btmpjg.god.bel.alcatel.be> (raw)
In-Reply-To: 4pj711$enp@goanna.cs.rmit.EDU.AU


rav@goanna.cs.rmit.EDU.AU writes :

>	ian@rsd.bel.alcatel.be (Ian Ward) writes:

>>On 5/6/95, in reply to Peter Hermann, who said
>>	">When I decide, as a programmer, that a pecu
>>	>variable may have a value in the range from 1 to 9, 
>>	>explain me why it should be useful to assign a value of 9
>>	>4711 or -1234?"

>>Robin, from Australia raplied.

>>"---Why, someone inevitably decides that the range is going
>>to be something different!  Users are apt to change their minds.
>>Then someone has to go in and modify the program.  Or, someone
>>overlooked a limit, and put in a limit one smaller than that
>>actually required.  Again, someone has to go in and find where
>>that limit is, and change it."

>> Ian, from the UK "raplied" [sic]:

>>I was just thinking that the other day. All the world software
>>engineering problems solved. No more boundaries to any variable,
>>and as I had 31 pounds and 312,032.231234 pence in my bank
>>account I could celebrate this solution to the software
>>crisis with a ride on a brand new -234 cc. Kawasaki Zx6R.

>>Ian Ward's opinions only : ian@rsd.bel.alcatel.be

>>Reminds me of a joke I once heard:

>>A man went into a certain pub, hoping to pull a swiftie on
>>the barman.  He asked: "Oi, have you change of an 18 pound note?"

>>The barman replied: "Aye.  What would you like? 2 nines or
>>3 sixes?"

> Seems to me that Ian has missed the point.

I am so sorry; there were two conclusions I could deduce
from a reply to a question about putting the value of ten
in a variable designed to hold only one to nine.

Firstly, there was mine, which was that the original 
programmer had decided, quite wrongly, that nought to 
nine was a valid range for this variable. As he 
was working from what some user was eventually going
to enter once he had produced the system, and not some
pre-defined spec which defined the system in the first
place (which the users got their chance to shout at.)
He should be sacked for failing to accurately predict
the future. Perhaps they should employ astrologers.

Secondly, there was the conclusion, that Peter Herman
was not talking about some variable at all when he
said the programmer wished to define a variable within
the range of 0 to 9. He was, in fact, talking about a
varying size of some array, say, or record component.

Had I known that that was his intent, and that, 'that'
was the point Robin brought up, or even if a project
required a varying length array, String etc. Then I
would have simply, as many other people who know what
they are talking about, have said :

Why did the programmer not simply define a varying
length array, string etc. and use it, such as.

procedure FRED ( HARRY : in STRING );

function JOHN (NUMBER : in INTEGER) return STRING;

both of these operations, return or take varying
length strings, with the added advantage that
the length, start and end points are defined within
the procedure, and if the user tries to examine
HARRY (4231) when HARRY is only defined from 0 to 9
then the user will know about it straight away,
unless the programmer decides not to tell him.

Furthermore, 
....

type MATRIX (A,B : integer := 5) is
   record 
      CONTENTS : array (1 .. A, 1 .. B) of INTEGER;
   end record;

function INVERT (MAT : in MATRIX) return MATRIX;
....

takes a varying defined setup, and can be fixed 
at compile time if one wishes, or not, can be
generated dynamically, statically or anyway one
pleases, but the end result is the same; which
is: why would anyone want to access component
number X if X is not in the range of valid
components. Nine times out of ten, or more,
it is going to be a fault.

Here is, of course, a case where myself and 
Robin have failed to notice vital information 
in text with which we were presented, I made 
the wrong conclusion on what Peter, and hence
Robin was talking about, (and mispelt, in the
heat of typing "replied".) Robin presumably also
in the heat of typing, mispelt "Belgium".

Faults like this happen every day when reading
requirements, and inevitably, now and again,
element 51, the 'last' element, of a 15 number
array is indexed, because someone was not
correctly assimilating the text in front of 
their eyes.

I feel safe at night knowing that the language's
run time checking caught this error during
the unit test phase, or earlier, during first
compilation, leaving the programmer time to 
work on all the other problems he has; such as 
predicting what the user will do tomorrow.

Groetjes,
Ian.

---
Ian Ward's opinions only : ian@rsd.bel.alcatel.be





  reply	other threads:[~1996-06-11  0:00 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4p0fdd$4ml@news.atlantic.net>
1996-06-04  0:00 ` next "big" language?? (disagree) Peter Hermann
1996-06-04  0:00   ` The Amorphous Mass
1996-06-04  0:00     ` Robert Dewar
1996-06-06  0:00       ` Ken Garlington
1996-06-12  0:00       ` Help making ada pretty CSC Trusted Systems Group
1996-06-14  0:00         ` Sandy McPherson
1996-06-19  0:00         ` Ruediger Berlich
1996-06-04  0:00     ` next "big" language?? (disagree) Peter Hermann
1996-06-04  0:00       ` The Amorphous Mass
1996-06-05  0:00         ` Michael David WINIKOFF
1996-06-07  0:00           ` Robert Dewar
1996-06-05  0:00     ` Ian Ward
1996-06-05  0:00       ` The Amorphous Mass
1996-06-08  0:00         ` Robert Dewar
1996-06-08  0:00           ` The Amorphous Mass
1996-06-09  0:00             ` Robert Dewar
1996-06-08  0:00         ` Robert Dewar
1996-06-05  0:00   ` ++           robin
1996-06-05  0:00     ` Ian Ward
1996-06-05  0:00       ` Ian Ward
1996-06-06  0:00         ` Richard Riehle
1996-06-07  0:00           ` Richard Riehle
1996-06-08  0:00             ` O'Connor
1996-06-07  0:00           ` Robert Dewar
1996-06-10  0:00             ` Richard Riehle
1996-06-11  0:00           ` ++           robin
1996-06-11  0:00             ` David Weller
1996-06-11  0:00             ` Chris Warack <sys mgr>
1996-06-11  0:00             ` James_Rogers
1996-06-11  0:00               ` Kevin J. Weise
1996-06-11  0:00         ` ++           robin
1996-06-11  0:00           ` Ian Ward [this message]
1996-06-12  0:00             ` ++           robin
1996-06-12  0:00               ` Ian Ward
1996-06-11  0:00       ` Jon S Anthony
     [not found]   ` <4p60nk$imd@euas20.eua.ericsson.se>
     [not found]     ` <4p8lmq$oq7@goanna.cs.rmit.edu.au>
1996-06-11  0:00       ` ++           robin
1996-06-11  0:00         ` A. Grant
1996-06-12  0:00           ` Robert Dewar
1996-06-17  0:00             ` A. Grant
1996-06-18  0:00               ` Robert Dewar
1996-06-24  0:00                 ` Robert I. Eachus
1996-06-26  0:00                   ` Norman H. Cohen
1996-06-19  0:00             ` Jon S Anthony
1996-06-20  0:00               ` Robert Dewar
1996-06-24  0:00                 ` Adam Beneschan
1996-06-24  0:00                 ` Dale Stanbrough
1996-06-24  0:00                   ` Adam Beneschan
1996-06-24  0:00                   ` Robert Dewar
1996-06-24  0:00                   ` Assertions (was: Re: next "big" language?? (disagree)) Robert A Duff
1996-06-24  0:00                     ` Assertions (a different intent?) Gary McKee
1996-06-24  0:00                     ` Assertions (was: Re: next "big" language?? (disagree)) Robert Dewar
1996-06-25  0:00                       ` Robert A Duff
1996-06-28  0:00                         ` Robert Dewar
     [not found]                     ` <4qrljg$15l8@watnews1.watson.ibm.com>
1996-06-28  0:00                       ` Robert Dewar
1996-06-24  0:00                   ` next "big" language?? (disagree) hopkinc
1996-06-24  0:00                   ` Lars Duening
1996-06-26  0:00                   ` Marc C. Brooks
1996-06-26  0:00                   ` Marc C. Brooks
     [not found]                   ` <4qsbm7$r1s@Starbase.NeoSoft.COM>
1996-06-28  0:00                     ` "Assert"? "Assume"? (was: next "big" language?? (disagree)) Alexander Bunkenburg
1996-06-28  0:00                       ` Ian Collier
1996-07-01  0:00                     ` Cameron Laird
1996-06-24  0:00                 ` next "big" language?? (disagree) Keith Thompson
1996-06-25  0:00                   ` Robert A Duff
1996-06-25  0:00                   ` Simon Read
1996-06-25  0:00                 ` Brian Nettleton @pulsar
1996-06-26  0:00                   ` Robert Dewar
1996-06-28  0:00                     ` Fergus Henderson
1996-06-28  0:00                       ` Robert Dewar
1996-06-30  0:00                         ` Fergus Henderson
1996-06-30  0:00                           ` Robert Dewar
1996-06-25  0:00                 ` Darin Johnson
1996-06-26  0:00                   ` Dale Stanbrough
1996-06-26  0:00                   ` A. Grant
1996-06-12  0:00           ` ++           robin
1996-06-12  0:00             ` A. Grant
1996-06-14  0:00               ` Richard A. O'Keefe
1996-06-12  0:00         ` Richard A. O'Keefe
1996-06-12  0:00           ` ++           robin
1996-06-12  0:00             ` Richard A. O'Keefe
1996-06-13  0:00               ` ++           robin
1996-06-13  0:00               ` ++           robin
1996-06-12  0:00   ` Jon S Anthony
1996-06-14  0:00   ` Jon S Anthony
1996-06-15  0:00   ` Jon S Anthony
1996-06-18  0:00     ` Adam Beneschan
1996-06-18  0:00   ` Jon S Anthony
1996-06-28  0:00     ` Assertions (an heretic view) Michel Gauthier
1996-06-28  0:00       ` Robert Dewar
1996-06-28  0:00       ` Robert A Duff
1996-06-06  0:00 ` next "big" language?? (disagree) Dale Pontius
1996-06-11  0:00 ` Jon S Anthony
1996-06-12  0:00 ` Help making ada pretty Pedro de las Heras
1996-06-18  0:00 ` next "big" language?? (disagree) ++           robin
1996-06-07  0:00 Ian Ward
1996-06-08  0:00 ` O'Connor
1996-06-10  0:00   ` Matt Kennel
1996-06-11  0:00     ` Ian Ward
1996-06-12  0:00       ` Norman H. Cohen
1996-06-11  0:00     ` Robb Nebbe
1996-06-09  0:00 ` Robert Dewar
replies disabled

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