more about programming style
Robert A. Weiler
bob at pedsgd.UUCP
Fri Jul 26 02:16:30 AEST 1985
Organization : Perkin-Elmer DSG, Tinton Falls NJ
Keywords:
Ill try to keep this short. This has gone on long enough. People use ++ and
other funny assignments because they are part of C and occur all over
the place in existing C code and C programming books. It should take
the average individual 5-15 minutes to figure out what these do, and then
he/she/it should remember it for life. This is a non-issue. A real problem
in C is type declaration syntax, as should be obvious from the number of
requests Chris Torek apparently got for cdecl source ( thanks Chris ).
I find a partial solution to the def problem is to use the following
style of declarations religously.
#define MYSTRUCT_T struct mystruct
struct mystruct {
int whatever;
MYSTRUCT_T *next;
};
typedef MYSTRUCT_T mystruct_t, *mystruct_p;
#define MYSTRUCTSZ (sizeof(mystruct_t))
#define NULLMYSTRUCT ((mystruct_p)0)
I would appreciate comments, suggestions, etc. on additional ways to
make type declarations more readable. But enough already about ++.
Bob Weiler.
More information about the Comp.lang.c
mailing list