From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51013 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OnXpP-0001cd-QD for qemu-devel@nongnu.org; Mon, 23 Aug 2010 10:16:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OnXpO-0007cM-J3 for qemu-devel@nongnu.org; Mon, 23 Aug 2010 10:16:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5131) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OnXpO-0007ar-Co for qemu-devel@nongnu.org; Mon, 23 Aug 2010 10:16:46 -0400 Message-ID: <4C727FE1.908@john-cooper.org> Date: Mon, 23 Aug 2010 10:04:17 -0400 From: john cooper MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 0/5] CODING_STYLE amendments References: <4C6A4291.1020105@redhat.com> <4C6A8CD8.2080701@codemonkey.ws> <4C715317.5020007@redhat.com> <4C722E00.80405@redhat.com> In-Reply-To: <4C722E00.80405@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes Sorensen Cc: john cooper , Markus Armbruster , qemu-devel , Blue Swirl , Miguel Di Ciurcio Filho Jes Sorensen wrote: > On 08/22/10 20:39, malc wrote: > >> Disregarding my own stance on the braces, braces around single statement >> is actually helpful w.r.t. debugging imaging trying to set a break point >> on said singlesttement, plain impossible in following case: >> >> if (a) b; >> > > Oh there is no talk about suggesting we force things onto a single line. > Putting if(foo) bar(); on the same line is just plain wrong, what I > referred to was this: > > if (foo) > bar(); > > vs > if (foo) { > bar(); > } > > If it is part of a multi-block if()/else block yes it's good for > consistency, if it is a one off in the code, it doesn't add any value > IMHO, it is a loss because it wastes space for no reason. > About the only benefit I've found for that added syntactic sugar is simplifying debug somewhat as you aren't falling in/out of the grammar optimization. But from a maintainability perspective, where possible I avoid formatting which dilutes the information content in a code window. It negatively impacts readability IMHO. -john