Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!agate!usenet.ins.cwru.edu!mcs.kent.edu!VAX1.CC.UAKRON.EDU!r3jjs From: r3jjs@VAX1.CC.UAKRON.EDU (Jeremy J Starcher) Newsgroups: comp.lang.c Subject: Re: Unnecessary parentheses (Was: Help: VAX C problem) Message-ID: <1208@VAX1.CC.UAKRON.EDU> Date: 3 Apr 91 14:35:55 GMT References: <1991Mar30.161854.27378@cbnewsk.att.com> <4072.27f7215c@iccgcc.decnet.ab.com> <1991Apr1.203600.15721@zoo.toronto.edu> <1#.gqcm@rpi.edu> Reply-To: r3jjs@VAX1.CC.UAKRON.EDU (Jeremy J Starcher) Organization: U of Akron Computer Center, Ohio Lines: 32 In article <1#.gqcm@rpi.edu> xor@aix01.aix.rpi.edu (Joseph Schwartz) writes: >In article <1991Apr1.203600.15721@zoo.toronto.edu> henry@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@vax1.cc.uakron.edu ! age 14... r3jjs@akronvm.bitnet !