PERFORCE change 126033 for review
LI Xin
delphij at delphij.net
Tue Sep 4 04:24:27 PDT 2007
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 at delphij.net> http://www.delphij.net/
FreeBSD - The Power to Serve!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/p4-projects/attachments/20070904/166d1494/signature.pgp
More information about the p4-projects
mailing list