[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Document Qemu coding style
From: |
Lennart Sorensen |
Subject: |
Re: [Qemu-devel] [PATCH] Document Qemu coding style |
Date: |
Mon, 30 Mar 2009 17:43:22 -0400 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
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
- [Qemu-devel] [PATCH] Document Qemu coding style, Avi Kivity, 2009/03/29
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, malc, 2009/03/29
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, Blue Swirl, 2009/03/30
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, M. Warner Losh, 2009/03/30
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, Avi Kivity, 2009/03/30
- Re: [Qemu-devel] [PATCH] Document Qemu coding style,
Lennart Sorensen <=
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, M. Warner Losh, 2009/03/30
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, Lennart Sorensen, 2009/03/30
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, M. Warner Losh, 2009/03/30
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, Laurent Desnogues, 2009/03/31
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, David Turner, 2009/03/31
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, Avi Kivity, 2009/03/31
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, David Turner, 2009/03/31
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, Blue Swirl, 2009/03/31
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, David Turner, 2009/03/31
- Re: [Qemu-devel] [PATCH] Document Qemu coding style, malc, 2009/03/31