Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uwm.edu!bionet!agate!saab.stanford.edu!neon!kanamori From: kanamori@Neon.Stanford.EDU (Atsushi Kanamori) Newsgroups: comp.lang.c Subject: Re: a style question Message-ID: <1990Sep30.172917.2951@Neon.Stanford.EDU> Date: 30 Sep 90 17:29:17 GMT References: <7341@darkstar.ucsc.edu> <1990Sep30.050655.13212@zoo.toronto.edu> Organization: Computer Science Department, Stanford University Lines: 24 In article <1990Sep30.050655.13212@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >In article <7341@darkstar.ucsc.edu> aryeh@cash.uucp (the over worked C something or another) 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++) ... > >Most people find it more readable with a bit of space and the statement >on the next line: > > for (x = 0; x != 100; x++) > ... > >The cautious would also recommend `x <= 100', but in this situation that >is arguable. I would say "x <= 100" is arguably bad. "x < 100" is more like it. More usefully, "<" seems to be a more common idiom than "!=" in upward counting loops. So using "<" will probably shave a few microseconds off the human reader's processing time.