From: David Weinehall <tao@acc.umu.se>
To: "Theodore Ts'o" <tytso@mit.edu>, Tim Hockin <thockin@hockin.org>,
Andries Brouwer <aebr@win.tue.nl>, Matt Mackall <mpm@selenic.com>,
Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Lindent fixed to match reality
Date: Fri, 30 Jan 2004 18:49:23 +0100 [thread overview]
Message-ID: <20040130174923.GU16675@khan.acc.umu.se> (raw)
In-Reply-To: <20040130144442.GA5081@thunk.org>
On Fri, Jan 30, 2004 at 09:44:42AM -0500, Theodore Ts'o wrote:
> On Fri, Jan 30, 2004 at 12:43:36AM +0100, David Weinehall wrote:
> > "Everyone" also sprinkles far too many parenthesis for their own code,
> > just to be sure. I've seen code such as
> >
> > a = b * c + 1;
> >
> > written as
> >
> > a = ((b * c) + 1);
> >
> > The question is rather, why should you insert superfluous parenthesis
> > when they do no semantic difference, and do not improve readability in
> > any way?
>
> I disagree; sometimes adding a few extra parenthesis *does* improve
> readability, especially if the expression is complex. Of course, if
> it's that complex, you might be better off defining a few extra
> variables and having named sub-expressions (it shouldn't make a
> difference to a good compiler).
Possibly "when they do" should've been "if they do" to clarify what I
meant. I don't mean that dropping all superfluous parantheses are
necessarily good, but most of the time, people tend to sprinkle the code
with them just because they lack in their knowledge of basic
C-programming. I'm not saying this is the case for the kernel, just
that I've seen it far too often.
I agree about the sub-expression bit though.
Regards: David Weinehall
--
/) David Weinehall <tao@acc.umu.se> /) Northern lights wander (\
// Maintainer of the v2.0 kernel // Dance across the winter sky //
\) http://www.acc.umu.se/~tao/ (/ Full colour fire (/
next prev parent reply other threads:[~2004-01-30 17:49 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-29 19:37 Matt Mackall
2004-01-29 19:44 ` Linus Torvalds
2004-01-29 20:00 ` Matt Mackall
2004-01-29 20:15 ` David Weinehall
2004-01-29 20:35 ` Måns Rullgård
2004-01-29 20:42 ` David Weinehall
2004-01-29 20:52 ` Måns Rullgård
2004-01-29 21:46 ` Matt Mackall
2004-01-29 22:37 ` Andries Brouwer
2004-01-29 22:54 ` David Weinehall
2004-01-29 23:17 ` Tim Hockin
2004-01-29 23:43 ` David Weinehall
2004-01-30 14:44 ` Theodore Ts'o
2004-01-30 17:49 ` David Weinehall [this message]
2004-01-30 21:08 ` Eric W. Biederman
2004-01-29 20:17 ` Roland Dreier
2004-01-29 20:37 ` Erik Hensema
2004-01-29 21:55 ` Krzysztof Halasa
2004-01-30 16:36 ` Linus Torvalds
2004-01-30 10:38 ` Jan-Benedict Glaw
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=20040130174923.GU16675@khan.acc.umu.se \
--to=tao@acc.umu.se \
--cc=aebr@win.tue.nl \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=thockin@hockin.org \
--cc=torvalds@osdl.org \
--cc=tytso@mit.edu \
/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
Powered by JetHome