Language principles
Jim Harkins
jharkins at sagpd1.UUCP
Tue Feb 20 09:44:23 AEST 1990
In article <645 at dino.cs.iastate.edu> hascall at cs.iastate.edu (John Hascall) writes:
> (people who do: #define 2 TWO, #define 3 THREE, ... should be beaten) ;-)
often and for long periods of time...
>
> #define N_TERMS 2 ==> #define N_TERMS 3
> average = (a + b) / N_TERMS; ==> average = (a + b + c) / N_TERMS;
I'm not sure what point your making here, but how about
this_average = (a + b) / 2;
that_average = (c + d + e) / 3;
I think the point is that while using symbolic constants is usually a good
idea, changing the word "usually" to "always" makes for a terrible rule.
Lets consider this beaten horse dead.
--
jim jharkins at sagpd1
"I've found by and large that when the flu gets you, the best thing to do (other
than go to bed, which is boring) is to go conquer something." -Jerry Pournelle
More information about the Comp.lang.c
mailing list