[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m3tzcxl91r.fsf@maximus.localdomain>
Date: Wed, 03 Sep 2008 14:15:44 +0200
From: Krzysztof Halasa <khc@...waw.pl>
To: Roland Dreier <rdreier@...co.com>
Cc: Hans Verkuil <hverkuil@...all.nl>,
LKML <linux-kernel@...r.kernel.org>,
"v4l-dvb maintainer list" <v4l-dvb-maintainer@...uxtv.org>
Subject: Re: CodingStyle question: multiple statements on a single line
Roland Dreier <rdreier@...co.com> writes:
> This is correct. Always write simple if statements as
>
> if (a)
> b;
The CodingStyle should never say "never" (nor "always").
Consider:
if (a) b;
else if (c) d;
else if (e) f;
etc.
If the list is long and expressions simple this is IMHO much more
readable. The same with
switch (a) {
case b: c; break;
case d: e; break;
and so on.
> Keep in mind that common sense always trumps any mechanical rule.
Precisely.
--
Krzysztof Halasa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists