Nonsense in BYTE reader columns
peters at cubsvax.UUCP
peters at cubsvax.UUCP
Thu Jun 26 01:22:37 AEST 1986
In article <utzoo.6849> henry at utzoo.UUCP (Henry Spencer) writes:
>> ...[redefining C syntax with macros]... The
>> point wasn't that you SHOULD do things this way, but that you COULD. And
>> there's nothing wrong with someone programming that way, if it increases
>> their efficiency and doesn't hinder the quality of the code...
>
>Provided that they realize that they're easing their own learning process
>a bit (c'mon, guys, how long does it take competent people to learn how
>to write "{}" and "=="?) at the price of having their own private dialect
>of C. In a more general context, yes there *is* something wrong with it:
>the result will be less intelligible to experienced C programmers, should
>they happen to hire any; ... [more good points]
Just a reminder that the possibility of this sort of usage is touted by K&R
as a virtue of the C preprocessor; pp86-87:
For example, Algol fans can say
#define then
#define begin {
#define end ;}
and then write
if ( i < 0 ) then
begin
a = 1;
b = 2;
end
Most of us agree that this is a bad idea, for the reasons mentioned; however,
it's not obvious that it's a bad idea. That's only become clear by dint of
peoples' experience with (other peoples') code written in this fashion.
Peter S. Shenkin Columbia Univ. Biology Dept., NY, NY 10027
{philabs,rna}!cubsvax!peters cubsvax!peters at columbia.ARPA
More information about the Comp.lang.c
mailing list