Language principles

John Hascall hascall at cs.iastate.edu
Sat Feb 17 12:32:29 AEST 1990


In article <1990Feb13.153513.2196 at hcr.uucp> john at troch.UUCP (John R. MacMillan) writes:
}In article <4721 at rtech.rtech.com> mikes at rtech.UUCP (Mike Schilling) writes:
}|From article <1990Feb9.181942.24649 at utzoo.uucp>, by henry at utzoo.uucp (Henry Spencer):

   [Zero, one, infinity rule]

}|I also remember a suggestion that languages force symbolic names to be used 
}|for constants other than zero and one, to make it harder to embed magic 
}|numbers in code.  I think this was Glenford Myers's idea.
 
}average = (a + b) / TWO

 (people who do: #define 2 TWO, #define 3 THREE, ... should be beaten)  ;-)
 
   #define N_TERMS 2              ==>   #define N_TERMS 3
   average = (a + b) / N_TERMS;   ==>   average = (a + b + c) / N_TERMS;

John Hascall  /  hascall at atanasoff.cs.iastate.edu



More information about the Comp.lang.c mailing list