From: Martin Knoblauch <spamtrap@knobisoft.de>
To: Krzysztof Halasa <khc@pm.waw.pl>, Joe Perches <joe@perches.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
"J. Bruce Fields" <bfields@fieldses.org>,
Dan Carpenter <error27@gmail.com>,
Andy Whitcroft <apw@canonical.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] checkpatch: putting the && or || on the wrong line
Date: Thu, 06 Jan 2011 11:55:56 +0000 [thread overview]
Message-ID: <376869.1852.qm@web113303.mail.gq1.yahoo.com> (raw)
In-Reply-To: <m3fwt7i740.fsf@intrepid.localdomain>
----- Original Message ----
> From: Krzysztof Halasa <khc@pm.waw.pl>
> To: Joe Perches <joe@perches.com>
> Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>; J. Bruce Fields
><bfields@fieldses.org>; Dan Carpenter <error27@gmail.com>; Andy Whitcroft
><apw@canonical.com>; linux-kernel@vger.kernel.org;
>kernel-janitors@vger.kernel.org
> Sent: Wed, January 5, 2011 6:38:07 PM
> Subject: Re: [patch] checkpatch: putting the && or || on the wrong line
>
> Joe Perches <joe@perches.com> writes:
>
> > As do I, but perhaps coding style in a project like this
> > shouldn't be personal but collective.
>
> I think there is nothing like a collective style.
> What you can eventually achieve is a style everybody hates.
>
> > The trailing style outnumbers the leading style ~ 5:1.
> >
> > $ grep -rP --include=*.[ch] "(\|\||&&)[ \t]*$" * | wc -l
> > 39890
> > $ grep -rP --include=*.[ch] "^[ \t]*(\|\||&&)" * | wc -l
> > 8244
> >
> > If you take out drivers/staging, trailing is used ~ 6:1.
> >
> > I think that high enough to be declared the preferred style.
Nobody defines which style *I* prefer. One (in this case the compiler) may
define which laws I obey, but not which style I like. As long as the compiler
accepts both notations and generates the same code there is no "law" against
either.
>
> This is a very weak reason (if any at all) to do so. Increasing e.g.
indeed.
> readability of the code would be a good reason, but statistics?
>
But who is defining readability? That is not a technical term at all. What I
view as readable may completely from your or Joes or anybody elses opinion.
> Maybe: Microsoft Windows outnumbers Linux X:1, so it should be declared
> the "preferred" system (= the only allowed, as with CodingStyle and
> checkpatch "errors").
>
> Or: cars outnumber trucks X:1, declare the trucks illegal.
I would really think about supporting that :-)
> Coffee drinkers outnumber tee drinkers, kill the later.
>
Here I am for personal freedom :-)
>
> Yes, we need some basic common style (tabs length, unless/until we can
> use any tab length), K&R (or other) parentheses, void *var instead of
> void* var (void* var1, var2 bugs), (no) spaces etc. Anything less make
Actually if this allows ambigous code, the language has a problem. But yeah, a
tool to enforce one way is good.
> the code unreadable or less readable. We should stop dictating the
> details when the benefits end, and they end pretty fast.
Amen.
Cheers
Martin
next prev parent reply other threads:[~2011-01-06 11:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 5:59 [patch] checkpatch: putting the && or || on the wrong line Dan Carpenter
2011-01-04 6:58 ` Joe Perches
2011-01-04 9:24 ` Dan Carpenter
2011-01-05 10:24 ` Martin Knoblauch
2011-01-04 16:38 ` J. Bruce Fields
2011-01-04 16:44 ` Samuel Thibault
2011-01-04 17:07 ` Joe Perches
2011-01-05 17:38 ` Krzysztof Halasa
2011-01-05 17:45 ` Joe Perches
2011-01-06 12:11 ` Martin Knoblauch
2011-01-06 17:43 ` Valdis.Kletnieks
2011-01-06 12:32 ` Krzysztof Halasa
2011-01-06 17:57 ` Joe Perches
2011-01-06 20:23 ` Krzysztof Halasa
2011-01-06 21:02 ` Joe Perches
2011-01-06 21:14 ` Krzysztof Halasa
2011-01-06 21:38 ` Joe Perches
2011-01-07 17:12 ` Valdis.Kletnieks
2011-01-08 13:42 ` Krzysztof Halasa
2011-01-08 17:12 ` Joe Perches
2011-01-06 11:55 ` Martin Knoblauch [this message]
2011-01-06 12:38 ` Krzysztof Halasa
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=376869.1852.qm@web113303.mail.gq1.yahoo.com \
--to=spamtrap@knobisoft.de \
--cc=apw@canonical.com \
--cc=bfields@fieldses.org \
--cc=error27@gmail.com \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=khc@pm.waw.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=samuel.thibault@ens-lyon.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