why bother with operator precedence

Eric S. Raymond eric at snark.uu.net
Wed Mar 28 08:44:26 AEST 1990


In <12845 at csli.Stanford.EDU> Bill Poser wrote:
> So, why bother with precedence?

I'll second your point and add that I think most expert C programmers use
parens rather than relying on precedence much beyond "* binds tighter than +"
and the fact that relationals bind tighter than && and ||. Myself, I wouldn't
have more than a vague idea of the hairier precedence/associativity rules
without looking at a chart, nor have I ever felt pressured to learn; parens
are cheap and give one that wonderful feeling of security.

Code defensively...the life you save may be your own!
-- 
      Eric S. Raymond = eric at snark.uu.net    (mad mastermind of TMN-Netnews)



More information about the Comp.lang.c mailing list