Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!dino!news.iastate.edu!IASTATE.EDU!john From: john@IASTATE.EDU (Hascall John Paul) Newsgroups: comp.lang.c Subject: Re: a style question Message-ID: <1990Sep30.194448@IASTATE.EDU> Date: 1 Oct 90 00:44:48 GMT References: <7341@darkstar.ucsc.edu> <8660@ncar.ucar.edu> Sender: usenet@news.iastate.edu (USENET News Poster) Reply-To: john@IASTATE.EDU (Hascall John Paul) Organization: Iowa State University Lines: 31 In article <8660@ncar.ucar.edu>, steve@groucho.ucar.edu (Steve Emmerson) writes: > > >Since I going to be doing my first team effort I want to know if this is bad > >style: > > for(x=0;x!=100;x++) ... > > It's OK, though some improvements could be made. ... > > for (x = 0; x < NUM_ELEMENTS; x++) ... This is really pointless, but I don't see that stopping anyone else... What is the generally preferred usage? Or does it matter at all? ++x; or x++; I find myself using ++x (which in my mind I attribute to some long gone, brain-damaged optimizer from my past -- but I still persist). My `favorite' is: --x; and x++; (pre-decrement, post-increment!!!) > Note also the use of additional whitespace. Please! -- John Hascall An ill-chosen word is the fool's messenger. Project Vincent Iowa State University Computation Center john@iastate.edu Ames, IA 50010 (515) 294-9551