Parenthesis

Bruno Medeiros brunodomedeiros+spam at com.gmail
Mon Jan 1 04:01:05 PST 2007


Sean Kelly wrote:
> Walter Bright wrote:
>> NN wrote:
>>> What about removing unuseful parenthesis in 'if', 'for', 'while' ?
>>
>> Because having redundancies in the syntax helps prevent bugs such as 
>> the following:
>>
>>> As told by Fred Webb in alt.folklore.computers in 1990:
>>>
>>> |  I worked at Nasa during the summer of 1963.  The group I was working
>>> |  in was doing preliminary work on the Mission Control Center computer
>>> |  systems and programs.  My office mate had the job of testing out an
>>> |  orbit computation program which had been used during the Mercury
>>> |  flights.  Running some test data with known answers through it, he 
>>> was
>>> |  getting answers that were close, but not accurate enough.  So, he
>>> |  started looking for numerical problems in the algorithm, checking to
>>> |  make sure his tests data was really correct, etc.
>>> |
>>> |  After a couple of weeks with no results, he came across a DO
>>> |  statement, in the form:
>>> |       DO 10 I=1.10
>>> |  This statement was interpreted by the compiler (correctly) as:
>>> |       DO10I = 1.10
>>> |  The programmer had clearly intended:
>>> |       DO 10 I = 1, 10
>>> |
>>> |  After changing the `.' to a `,' the program results were correct to
>>> |  the desired accuracy.  Apparently, the program's answers had been
>>> |  "good enough" for the sub-orbital Mercury flights, so no one 
>>> suspected
>>> |  a bug until they tried to get greater accuracy, in anticipation of
>>> |  later orbital and moon flights.  As far as I know, this particular 
>>> bug
>>> |  was never blamed for any actual failure of a space flight, but the
>>> |  other details here seem close enough that I'm sure this incident 
>>> is the
>>> |  source of the DO story.
> 
> Fortran is an evil, evil language.
> 
> 
> Sean

Glad we kids nowadays never had to deal with horrors like that and COBOL. :P

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list