[net.lang.c] abuse of #define

dlc@sei.cmu.edu.ARPA (Daryl Clevenger) (09/18/85)

I also think that things like :

#define cylce for(;;) {

and others are confusing.  Not only as was previously pointed out can 
unforseen errors creep in, but understanding and modifying code is a pain.
I feel that if someone is using C, then the reason they are doing so is
that it is either their favorite language or the best language for the
application.  This means one must put up with its syntax so that there is
as much uniformity as possible between programs.  Besides Joe Smith may
define foo as something and Frank Jones may define foo as something completely
different.  Imagine switching between programs with both.  YUK!  Fortunately,
most languages do not have a preprocessor as in C, so please don't abuse the
one that C has.  I like to keep my sanity.

	Daryl

dick@tjalk.UUCP (Dick Grune) (09/24/85)

In article <206@sei.cmu.edu.ARPA> dlc@sei.cmu.edu.ARPA (Daryl Clevenger) writes:
>I also think that things like :
>
>#define cylce for(;;) {
>
>and others are confusing.  Not only as was previously pointed out can 
>unforseen errors creep in, but understanding and modifying code is a pain.

On top of that it plays havox with cross referencers, beautifiers, or
any other programs that processes C text (and many cannot run the 
preprocessor first, if they want to work on the optical text).

I think #define should be used for defining small modifications, and
fortunately most people seem to agree (but not everybody, judging from
the text of sh).

					Dick Grune
					Vrije Universiteit
					de Boelelaan 1081
					1081 HV  Amsterdam
					the Netherlands