From: Julien Grall <julien.grall@arm.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
Jan Beulich <JBeulich@suse.com>
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
George.Dunlap@eu.citrix.com, tim@xen.org,
ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH 2/2] CODING_STYLE: Forbid nested block in the hypervisor code
Date: Tue, 4 Jul 2017 18:16:20 +0100 [thread overview]
Message-ID: <5a92fcfe-7b9d-d652-1ef5-22fb246f8aac@arm.com> (raw)
In-Reply-To: <7dfcee37-7a72-5885-08c3-bf7374c51513@citrix.com>
Hi,
On 07/04/2017 03:17 PM, Andrew Cooper wrote:
> On 04/07/17 13:20, Jan Beulich wrote:
>>>>> On 04.07.17 at 14:12, <julien.grall@arm.com> wrote:
>>> When removing if/for/while statements, the code should be reworked to
>>> remove the { } and the extra indentation.
>> Yes.
>>
>>> This is improving code maintainability and code readability.
>> For the given example, yes. However, there are (rare) cases where
>> having such nested blocks actually improves readability, for example
>> in certain combinations with preprocessor conditionals. Hence I don't
>> think we should forbid them.
>
> There are also a few specific cases where it is useful to use blocks
> like that to introduce a new variable, where introducing it at function
> level scope isn't appropriate. (Alternatively, we could switch from C89
> to C99, but that is a separate discussion).
>
> I agree that we should discourage the use of blocks like this, but not
> forbid them outright.
Thank you both for the feedback. I will rework the proposal to
discourage contributor rather than forbid.
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-07-04 17:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 12:12 [PATCH 1/2] CODING_STYLE: removing trailing whitespaces Julien Grall
2017-07-04 12:12 ` [PATCH 2/2] CODING_STYLE: Forbid nested block in the hypervisor code Julien Grall
2017-07-04 12:20 ` Jan Beulich
2017-07-04 14:17 ` Andrew Cooper
2017-07-04 17:16 ` Julien Grall [this message]
2017-07-04 14:13 ` [PATCH 1/2] CODING_STYLE: removing trailing whitespaces Wei Liu
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=5a92fcfe-7b9d-d652-1ef5-22fb246f8aac@arm.com \
--to=julien.grall@arm.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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).