Nonsense in BYTE reader columns
nigel
nigel at minster.UUCP
Thu Jun 19 08:04:22 AEST 1986
In article <639 at ucbcad.BERKELEY.EDU> chapman at pavepaws.UUCP (Brent Chapman) writes:
>In article <8606141823.AA12695 at pavepaws> dillon at PAVEPAWS.BERKELEY.EDU (Matt Dillon) writes:
>>
>> Get a Load of this, everyone (May 1986 Byte)
> [lines concerning misinformed Atari fanatic deleted]
>> The other thing in the BYTE issue that really made me puke was their
>>article "Easy C". The author attempts to convince the reader that C would
>>be much better if you didn't use it's constructs .. replacing them with
>>#define equivalants which make C look like Pascal. Next, he'll be telling
>>us not to use pointers. Give me a break!
>>
>> -Matt
>
>If I remember correctly, the basic ideas of the article were:
> 1) We have a group of programmers who don't know C. (gasp!!! :-)
> 2) We have a program that (for SOME reason; I don't remember
> what it was) MUST be written in C.
> 3) We don't have time for them to become proficient in C. (Let's
> be honest folks: C is NOT the easiest language in the world
> when you're first learning it.)
> 4) This is what we did to ease the transition.
>
>I felt that the article was a fine testimony to the flexibility of C. The
....
>
>Brent
The apporach of 'sugaring' C is not unusual - have you looked at the source
code for sh? What I felt was wrong with the article was the "lets invent
a macro substitution for every construct whether it needs one or not"
attitude. Why, for instance, does <= need to be defined as LE ?? Very shortly
we get
if ((c >= 'a' && c <= 'z')||(c >= 'A' && c <= 'Z'))
replaced by
if ((c GE 'a' AND c LE 'z') OR (c GE 'A' AND c LE 'Z'))
This looks more like FORTRAN that Pascal ... now that I do take exception to.
The <= construct (and related ones) are fine as they are. I also doubt that
BAND is more meaningful for bitwise and than &. Finally, I we wish to make
C look like Pascal, try
#define THEN
allowing
IF (((c >= 'a') AND (c <= 'z'))OR((c >= 'A') AND (c <= 'Z'))) THEN
which is correct Pascal (or if it isn't you get my drift).
More information about the Comp.lang.c
mailing list