Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!ima!minya!jc
From: jc@minya.UUCP
Newsgroups: comp.unix.questions
Subject: Re: Summary Re: Brain-dead Unix tutor needs quick help (-1)
Message-ID: <414@minya.UUCP>
Date: Wed, 25-Nov-87 22:06:25 EST
Article-I.D.: minya.414
Posted: Wed Nov 25 22:06:25 1987
Date-Received: Sun, 29-Nov-87 02:32:50 EST
References: <387@cogen.UUCP> <6700@brl-smoke.ARPA> <391@cogen.UUCP>
Organization: home
Lines: 21

> The answer I will use in this case will be one of style. It is good practise
> to ALWAYS bracket expressions in case they come back to bite you or you
> happen to port through an old compiler. Always bracketing expressions
> (it should become a habit) will save debugging time and the programmer
> should not be concerned with special cases that are immune to the
> specific effect (in case, being human, (s)he misses an important counter).

When I was a novice C programmer, I frequently made the mistake of trying
to use the precedence rules to save a few keystrokes of typing; after several
long hours spent tracking down bugs that were corrected by a pair of parens,
I learned my lesson.  Since then, I've noticed that many experience C hackers
routinely over-parenthesize their code.  It's easier than debugging.

One of the minor problems with C is that there are just too many operators
for the memory of most mere humans.  Also, some of the precedence rules
are, while not exactly counter-intuitive, at least somewhat non-intuitive.
I've tried to teach this lesson to quite a few up-and-coming C programmers
since then.  They never listen, of course.

-- 
John Chambers <{adelie,ima,maynard,mit-eddie}!minya!{jc,root}> (617/484-6393)