All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: malc <av1474@comtv.ru>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Drop braces around single statement rule
Date: Sat, 31 Jul 2010 18:47:29 +0200	[thread overview]
Message-ID: <20100731164729.GM20459@volta.aurel32.net> (raw)
In-Reply-To: <1280593414-2232-1-git-send-email-av1474@comtv.ru>

On Sat, Jul 31, 2010 at 08:23:34PM +0400, malc wrote:
> History has shown that this particular rule is unenforcable.
> 
> Signed-off-by: malc <av1474@comtv.ru>
> ---
>  CODING_STYLE |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/CODING_STYLE b/CODING_STYLE
> index 92036f3..e0b5376 100644
> --- a/CODING_STYLE
> +++ b/CODING_STYLE
> @@ -54,16 +54,17 @@ readers that they are seeing a wrapped version; otherwise avoid this prefix.
>  
>  4. Block structure
>  
> -Every indented statement is braced; even if the block contains just one
> -statement.  The opening brace is on the line that contains the control
> -flow statement that introduces the new block; the closing brace is on the
> -same line as the else keyword, or on a line by itself if there is no else
> -keyword.  Example:
> +The opening brace is on the line that contains the control flow
> +statement that introduces the new block; the closing brace is on the
> +same line as the else keyword, or on a line by itself if there is no
> +else keyword. Example:
>  
>      if (a == 5) {
>          printf("a was 5.\n");
> +        do5stuff();
>      } else if (a == 6) {
>          printf("a was 6.\n");
> +        do6stuff();
>      } else {
>          printf("a was something else entirely.\n");
>      }

I am "neutral" on this particular rule.

OTOH, my opinion is that we really should try to enforce the rules. The
fact that we are humans and make mistakes (some patches not enforcing
all the rules are committed), is not enough to just ignore the rules. If
a rule is not enforceable, it should be removed from CODING_STYLE, not
removed.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2010-07-31 16:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-31 16:23 [Qemu-devel] [PATCH] Drop braces around single statement rule malc
2010-07-31 16:47 ` Aurelien Jarno [this message]
2010-07-31 16:51   ` Aurelien Jarno
2010-07-31 20:23 ` Blue Swirl
2010-07-31 20:35   ` malc
2010-07-31 23:49   ` Aurelien Jarno
2010-08-02 15:20     ` Anthony Liguori
2010-08-02 15:41       ` Kevin Wolf
2010-08-02 15:48         ` Anthony Liguori
2010-08-02 16:06           ` malc
2010-08-02 16:18             ` Anthony Liguori
2010-08-02 16:29               ` Blue Swirl
2010-08-02 16:32                 ` Anthony Liguori
2010-08-02 15:55         ` malc
2010-08-02 16:04           ` Anthony Liguori
2010-08-02 16:24       ` Blue Swirl

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=20100731164729.GM20459@volta.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=av1474@comtv.ru \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.