Path: utzoo!attcan!uunet!know!cs.utexas.edu!mailrus!ames!ncar!groucho!steve From: steve@groucho.ucar.edu (Steve Emmerson) Newsgroups: comp.lang.c Subject: Re: a style question Message-ID: <8660@ncar.ucar.edu> Date: 30 Sep 90 19:49:08 GMT References: <7341@darkstar.ucsc.edu> Sender: news@ncar.ucar.edu Organization: University Corporation for Atmospheric Research (UCAR) Lines: 23 In comp.lang.c you write: >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. Old-timers would ususally write "x < 100" rather than "x != 100" as it expresses the sense of direction (incrementation) slightly better, and they're more used to seeing it that way. A slightly more important improvement would be to use a symbolic variable or constant for the, otherwise, non-obvious "100" value. Something like # define NUM_ELEMENTS 100 for (x = 0; x < NUM_ELEMENTS; x++) ... Note also the use of additional whitespace. Steve Emmerson steve@unidata.ucar.edu ...!ncar!unidata!steve