Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/28/84; site lll-crg.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!umcp-cs!gymble!lll-crg!brooks From: brooks@lll-crg.ARPA (Eugene D. Brooks III) Newsgroups: net.lang.c Subject: Re: Re: C programming style Message-ID: <703@lll-crg.ARPA> Date: Thu, 18-Jul-85 01:26:27 EDT Article-I.D.: lll-crg.703 Posted: Thu Jul 18 01:26:27 1985 Date-Received: Sat, 20-Jul-85 02:47:43 EDT References: <11434@brl-tgr.ARPA> <480@mmintl.UUCP> Organization: Lawrence Livermore Labs, CRG group Lines: 23 > I agree that "i++" is an abomination. (I do use it, however, to be > consistent with the rest of the code I work with.) Actually, C has > a third way to represent this operation: "i += 1". Personally, I > think this is the superior notation. It is concise, yet easy enough > for a person unfamiliar with the language to interpret. The use of i++ when i+=1 will do is certainly an abomination! I personally always use i+=1 when i just want to increment i but an not going to use its value in that expression. For instance for(i = 0; i < DIM; i += 1) People ask me WHY? As it noted above everyone just uses i++. I reserve the ++ and -- operators for when I an really doing something special, incrementing or decrementing and using the value that existed BEFORE the operation. The occurence of ++ or -- in a program is a red flag telling the reader that something very special is happening. If you use ++ or -- when you simply want to decrement or increment then the cases when its important to note the ordering of the operation and the returned value of the expression get lost in the forest of ++s and --s an you get left with buggy code. Its the very much the crying wolf syndrome!