Unnecessary parentheses (Was: Help: VAX C problem)

Jeremy J Starcher r3jjs at VAX1.CC.UAKRON.EDU
Thu Apr 4 00:35:55 AEST 1991


In article <1#.gqcm at rpi.edu> xor at aix01.aix.rpi.edu (Joseph Schwartz) writes:
>In article <1991Apr1.203600.15721 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
>Just curious...how often do you folks purposely insert unnecessary parens
>into expressions?  Sometimes I'll do it just to make the grouping clearer
>(just in case the next person to read the code doesn't know all the
>precedence rules by heart).  I'm talking about expressions in general,
>not just in conjunction with return or sizeof.
>

	I use paren's all the time.  The first C compiler I ever used
had *no* orders of operations.  It did things left to right.  Period.

So... I got into the habit of putting parens around everthing.  This was
then aggrivated when the language we used at work had a *different* order
of operation than the C compiler I used at home.

So, I will put parens around everthing so I am sure how it will be
evaluated and for clarity.


ie.
    if ( (a == 10) && (ful == FALSE) )

    return ( (bar*10) +1);

 etc.

-- 
--------------------------+---------------------------------------------------
Jeremy J Starcher         !  No programmer programs in LOGO after reaching
r3jjs at vax1.cc.uakron.edu  !  age 14...
r3jjs at akronvm.bitnet      !



More information about the Comp.lang.c mailing list