From: "M. Warner Losh" <imp@bsdimp.com>
To: qemu-devel@nongnu.org, lsorense@csclub.uwaterloo.ca
Subject: Re: [Qemu-devel] [PATCH] Document Qemu coding style
Date: Mon, 30 Mar 2009 16:15:14 -0600 (MDT) [thread overview]
Message-ID: <20090330.161514.117919654.imp@bsdimp.com> (raw)
In-Reply-To: <20090330214321.GP3795@csclub.uwaterloo.ca>
In message: <20090330214321.GP3795@csclub.uwaterloo.ca>
lsorense@csclub.uwaterloo.ca (Lennart Sorensen) writes:
: 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.
With editors like emacs, this isn't an issue.
: I also like consistency, and since you need braces for multiline
: statements, why not always use them?
Because it stretches the code vertically. More extra useless 'blank'
lines makes it harder to get more code on the screen, which makes the
code harder to understand.
Anyway, this is a highly religious issue. Either you think that {}
are the bee's knees and people are morons that don't use them, or you
hate them with a huge passion and can't believe people are stupid
enough to require it. There's a very small set of folks in between,
and often little common ground: usually one camp tolerates the
practices of the other...
Warner
next prev parent reply other threads:[~2009-03-30 22:17 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-29 21:23 [Qemu-devel] [PATCH] Document Qemu coding style Avi Kivity
2009-03-30 1:15 ` malc
2009-03-30 18:28 ` Blue Swirl
2009-03-30 19:02 ` M. Warner Losh
2009-03-30 19:55 ` Avi Kivity
2009-03-30 19:54 ` Avi Kivity
2009-03-30 21:43 ` Lennart Sorensen
2009-03-30 22:15 ` M. Warner Losh [this message]
2009-03-30 23:38 ` Lennart Sorensen
2009-03-31 0:09 ` M. Warner Losh
2009-03-31 5:59 ` Laurent Desnogues
2009-03-31 12:58 ` David Turner
2009-03-31 13:31 ` Avi Kivity
2009-03-31 21:18 ` David Turner
2009-03-31 16:18 ` Blue Swirl
2009-03-31 21:48 ` David Turner
2009-03-31 22:38 ` malc
2009-03-31 23:28 ` David Turner
2009-03-31 23:49 ` malc
2009-04-01 0:25 ` David Turner
2009-04-01 1:02 ` malc
2009-04-01 9:04 ` Daniel P. Berrange
2009-03-30 19:58 ` Avi Kivity
2009-03-30 20:10 ` Glauber Costa
2009-03-30 20:35 ` Avi Kivity
2009-03-30 20:37 ` Glauber Costa
2009-03-30 20:20 ` Andreas Färber
2009-03-30 21:45 ` Lennart Sorensen
2009-03-30 22:16 ` M. Warner Losh
2009-03-31 5:42 ` Gleb Natapov
2009-03-31 13:47 ` Paul Brook
2009-04-01 8:51 ` Richard W.M. Jones
2009-04-01 9:04 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090330.161514.117919654.imp@bsdimp.com \
--to=imp@bsdimp.com \
--cc=lsorense@csclub.uwaterloo.ca \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).