From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LoPGS-0006cp-MW for qemu-devel@nongnu.org; Mon, 30 Mar 2009 17:43:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LoPGO-0006ZM-2v for qemu-devel@nongnu.org; Mon, 30 Mar 2009 17:43:28 -0400 Received: from [199.232.76.173] (port=37165 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LoPGN-0006ZB-SS for qemu-devel@nongnu.org; Mon, 30 Mar 2009 17:43:23 -0400 Received: from caffeine.csclub.uwaterloo.ca ([129.97.134.17]:37349) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LoPGN-0005NG-IA for qemu-devel@nongnu.org; Mon, 30 Mar 2009 17:43:23 -0400 Received: from caffeine.csclub.uwaterloo.ca (localhost [127.0.0.1]) by caffeine.csclub.uwaterloo.ca (Postfix) with ESMTP id 2BED373DD6 for ; Mon, 30 Mar 2009 17:43:22 -0400 (EDT) Date: Mon, 30 Mar 2009 17:43:22 -0400 Subject: Re: [Qemu-devel] [PATCH] Document Qemu coding style Message-ID: <20090330214321.GP3795@csclub.uwaterloo.ca> References: <1238361823-24939-1-git-send-email-avi@redhat.com> <49D12392.6040107@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49D12392.6040107@redhat.com> From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Mon, Mar 30, 2009 at 10:54:58PM +0300, Avi Kivity wrote: > Blue Swirl wrote: >>> +4. Block structure >>> + >>> +Every indented statement is braced; even if the block contains just one >>> +statement. >>> >> >> I'd remove this, braces are not used consistently for one statement blocks. >> >> > > While that's true, I'd like to keep this. I found (after initially > being annoyed by this; I dislike punctuation) that it's nice not to need > to rebrace after adding or removing lines. I hate having to add braces to add a printf when debuging something. If you forget the braces, you change the meaning of the code. To me that's a disaster and enough reason that leaving out braces should be banned. Code style that encourages creation of bugs is bad style. Surprisingly many code styles don't get this however. I also like consistency, and since you need braces for multiline statements, why not always use them? -- Len Sorensen