for(;;) vs. while(1) is a draw

Paul D. Crowley aipdc at castle.ed.ac.uk
Sat May 26 06:55:14 AEST 1990


In article <12986 at smoke.BRL.MIL> gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
>"true" is logical.  "1" has to be explained as a special quirk of C.

bph at buengc.bu.edu (Blair P. Houghton) sez in <5907 at buengc.BU.EDU>
>As is done long before you get around to presenting `while'
>and `for'.

Well, not necessarily.   In fact, it would surprise me if by the time
you were presenting "for" you'd told people that integers were used to
represent boolean values.  Most people at that level of programming only
have the vaguest idea what a boolean value is anyway. "3<4" people can
cope with;  "3<4 == TRUE" is for mathematicians. "3<4 != 0" is abtruse.

Peeve: why doesn't C have a type "boolean" built in? It seems natural,
and I'm sure there's some compiler somewhere that could use it to
improve executables.

-- 
\/ o\ Paul Crowley aipdc at uk.ac.ed.castle
/\__/ "Trust me, I know what I'm doing" - Sledge Hammer



More information about the Comp.std.c mailing list