Date: Tue, 04 Sep 2007 19:03:51 +0800 From: LI Xin <delphij@delphij.net> To: Hans Petter Selasky <hselasky@c2i.net> Cc: freebsd-hackers <freebsd-hackers@freebsd.org>, Perforce Change Reviews <perforce@FreeBSD.ORG>, Xin LI <delphij@FreeBSD.ORG> Subject: Re: PERFORCE change 126033 for review Message-ID: <46DD3B97.1020205@delphij.net> In-Reply-To: <200709041121.45990.hselasky@c2i.net> References: <200709040755.l847tPbn003371@repoman.freebsd.org> <200709041121.45990.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hi, Hans,
Hans Petter Selasky wrote:
> Hi,
>
> In my opinion you should keep braces around single line if's .
>
> if (xxx) {
> yyy;
> }
>
> This will reduce the chance of error next time you add a statement to an if.
I think I have some different understanding.
My opinion is that with excessive use of these { and }'s the code could
be sometimes confusing to human reader, especially if there are a lot of
consecutive single line if's that can not be easily converted to case
(e.g. in case we wanted to test bit masks, etc).
Also to quote style(9):
%%%%%%%%%%%%%%%%%
No braces (`{' and `}') are used for control statements with zero or
only a single statement unless that statement is more than a single line
in which case they are permitted. Forever loops are done with for's,
not while's.
%%%%%%%%%%%%%%%%%
Because msdosfs is considered as our own code (e.g. we don't want to
sync it with a foreign vendor who has different style guidelines), I
think it would be more appropriate to obey style(9)'s rules.
Cheers,
--
Xin LI <delphij@delphij.net> http://www.delphij.net/
FreeBSD - The Power to Serve!
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG3TuXOfuToMruuMARCvlbAJ9NPZr+Jbq/KoczUPGog+jyTwtlCQCfYD5y
TclNtgRdzWFkUwqn0UYpgi8=
=9PP6
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46DD3B97.1020205>
