[TUHS] History of popularity of C
Derek Fawcus
dfawcus+lists-tuhs at employees.org
Mon Jun 8 23:56:19 AEST 2020
On Sat, Jun 06, 2020 at 05:49:23PM -0400, Doug McIlroy wrote:
> Syntactically it occurs at top level completely out of sync with the
> indentation and flow of text. Conversion to if would be a big win.
Well, doesn't that rather depend upon how one indents it?
As I recall, that freedom came with ANSI C.
But yeah, I'd prefer the if(0) type of elimination.
DF
$ cc yes-no.c; ./a.out; cc -DYES yes-no.c; ./a.out; cat yes-no.c
No
Yes
#include <stdio.h>
int main(void)
{
#ifdef YES
puts("Yes");
#else
puts("No");
#endif
return 0;
}
More information about the TUHS
mailing list