Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!jyegiguere From: jyegiguere@watmath.UUCP Newsgroups: comp.lang.c Subject: Re: Style [++i vs i++] Message-ID: <13902@watmath.UUCP> Date: Mon, 13-Jul-87 08:31:37 EDT Article-I.D.: watmath.13902 Posted: Mon Jul 13 08:31:37 1987 Date-Received: Tue, 14-Jul-87 04:53:30 EDT References: <17310@amdcad.AMD.COM> <2159@emory.uucp> <43@ghsvax.UUCP> <795@nu3b2.UUCP> <404@uop.UUCP> Reply-To: jyegiguere@watmath.waterloo.edu (Eric Giguere) Organization: U. of Waterloo, Ontario Lines: 32 In any half-decent compiler the statements ++i; i++; should produce the same code. What we're really discussing here is more of a stylistic thing than anything, and like all stylistic matters this is subject to personal tastes. I prefer the pre-increment form myself, both because it can be easily read as "increment i", but also because it makes the compiler's job easier... it doesn't have to store i in a temp, increment i, then realize that it doesn't need the temp, etc., etc. In other words, it reduces the need for the optimizer. But then again, I don't know if it's worth arguing about. There seem to be other matters that might be more relevant.... like why the ANSI Standard is so wishy-washy (oh, oh, here come the flames.....) --------------------------------------------------------------------- Computer Systems Group CCCCC SSSSS GGGGG Eric Giguere CC SS GG CC SSSSS GG GG jyegiguere@watmath.waterloo.edu CC SS GG GG CCCCC SSSSS GGGGG giguere@watcsg.bitnet University of Wateroo Disclaimer: The opinions expressed above are not intended to represent those of either the Computer Systems Group or the University of Waterloo.