From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f891f,9d58048b8113c00f X-Google-Attributes: gidf891f,public X-Google-Thread: 103376,2e71cf22768a124d X-Google-Attributes: gid103376,public X-Google-Thread: 10cc59,9d58048b8113c00f X-Google-Attributes: gid10cc59,public X-Google-Thread: 1014db,9d58048b8113c00f X-Google-Attributes: gid1014db,public From: ian@rsd.bel.alcatel.be (Ian Ward) Subject: Re: next "big" language?? (disagree) Date: 1996/06/11 Message-ID: <4pk88b$hfs@btmpjg.god.bel.alcatel.be> X-Deja-AN: 159669393 distribution: world references: <4pj711$enp@goanna.cs.rmit.EDU.AU> organization: Alcatel Bell Telephone reply-to: ian@rsd.bel.alcatel.be newsgroups: comp.lang.ada,comp.lang.pascal,comp.lang.c,comp.lang.misc Date: 1996-06-11T00:00:00+00:00 List-Id: 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