Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!emory!platt From: platt@emory.uucp (Dan Platt) Newsgroups: comp.lang.c Subject: Re: Style [++i vs i++] Message-ID: <2159@emory.uucp> Date: Tue, 30-Jun-87 20:57:59 EDT Article-I.D.: emory.2159 Posted: Tue Jun 30 20:57:59 1987 Date-Received: Wed, 1-Jul-87 07:22:15 EDT References: <17310@amdcad.AMD.COM> Reply-To: platt@emory.UUCP (Dan Platt) Organization: Math & Computer Science, Emory University, Atlanta Lines: 29 In article <17310@amdcad.AMD.COM> tim@amdcad.AMD.COM (Tim Olson) writes: >OK, now that we have opened up the "style" issue with !p vs p != NULL (sic), >how about another: > >Which operator (pre-increment or post-increment) do you use when the side- >effect is the only desired action and the result is discarded, i.e. > > for (i=0; ivs > for (i=0; ior > ++counter; vs counter++; > >Personally, the use of post-increment operators here drives me crazy. I prefer post-increment in these cases since i++; reminds me of i += 1; which I find more agreeable. Needless to say, most compilers will handle the above the same way regardless of whether it was pre or post incremented. But then, this is all a matter of taste, and it's a bad idea to call another person's spouse ugly. Otherwise, it's nice having them both around... Dan