Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 41588 invoked by uid 500); 11 Mar 2002 14:02:46 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 41561 invoked from network); 11 Mar 2002 14:02:45 -0000 Message-ID: <003b01c1c905$bdab1590$af381b09@sashimi> From: "Bill Stoddard" To: References: Subject: Re: Minor(?) style questions Date: Mon, 11 Mar 2002 09:04:57 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ----- > Hi, > > Just checking if people have given this some thought before. > And, maybe if there was something decided on this matter. For > instance, that this is free when it comes to style rules. > > As some of you have noticed I am doing style reviews of/ > corrections on the current httpd codebase, which has the nice > sideeffect of getting us some basic code review aswell. With > everything in a consistent style, review by other parties will > be easier aswell. Not to mention that one can probably read > the code quicker... > > So, just a few simple questions: > > 1) Can we decide on a standard style when it comes to using > ++ or --? > > Example: > > lines++; > > vs. > > ++lines; > > We are currently mixing this in the current code base. > I personally favor the first. And unless we are testing > the variable in an expression, pre- or postfix doesn't > matter for the resulting binary, only for readability. > > I would vote for both :-) Either are equally readable IMHO (I tend to use the first, FWIW). > 2) How should a do {} while look like? > > do { > ... > } while (...); > > or > > do { > ... > } > while (...); > The first style is more compact and not less readable than the second, IMO. > > 3) What is the preferred method of doing an infinite loop? > > while (1) { > ... > } > > or > > for (;;) { > ... > } > I like using the while(1) style. No justification ... > > Thanks, > > Sander I would prefer to keep the style guidelines as small as possible. I would be in favor of adding 2) to the existing guidelines and leaving 1) and 2) personal choice. Bill