- To: Roland Dreier <rdreier@xxxxxxxxx>
- Subject: Re: CodingStyle question: multiple statements on a single line
- From: Krzysztof Halasa <khc@xxxxxxxxx>
- Date: Wed, 03 Sep 2008 14:15:44 +0200
- In-reply-to: <ada7i9ufa7x.fsf@xxxxxxxxx> (Roland Dreier's message of "Tue\, 02 Sep 2008 15\:34\:42 -0700")
Roland Dreier <rdreier@xxxxxxxxx> 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
_______________________________________________
v4l-dvb-maintainer mailing list
v4l-dvb-maintainer@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/v4l-dvb-maintainer
[Linux Media]
[Older V4L]
[Linux DVB]
[Video Disk Recorder]
[Asterisk]
[Photo]
[DCCP]
[Netdev]
[Xorg]
[Util Linux NG]
[Xfree86]
[Free Photo Albums]
[Fedora Users]
[Fedora Women]
[ALSA Users]
[ALSA Devel]
[SSH]
[Linux USB]
 |
 |
-->