[comp.lang.c] Readable code

gea@Iago.Caltech.EDU (Gary Ansok) (07/15/87)

As long as we're mentioning our own little foibles, I have never had
any trouble conceptualizing (there's a nice gobbledygook word) the
test 

	if (p)
as
	if (p is a valid pointer)      /* i.e., p is not NULL */

In other words, a pointer can be treated as a boolean in the sense of
it either points to something (TRUE) or it doesn't (FALSE).  Actually,
what I find hardest to read about other people's code is that many
people don't use whitespace around operators.

Also, we have a few programmers around here who believe in
`no embedded constants' -- a good rule in moderation, but when carried
to excess it can lead one to jump up and down the page looking for the
definition of each parameter.  Also, it can lead to nonsense like
`#define ONE 1' from people who don't understand -- I had to change one
of these once, and I did _not_ change it to `#define ONE 2'. ;-)

	Gary Ansok
	ansok@scivax.arpa       -- or --      gea@romeo.caltech.edu

The preceding opinions are those of the speaker, and are not necessarily
those of this node or the Internet computer network.