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 <[EMAIL PROTECTED]>      http://www.delphij.net/
FreeBSD - The Power to Serve!

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to