Skip site navigation (1)Skip section navigation (2)
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
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig7CBE5F8D6D5880C3862BF559
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi, Hans,

Hans Petter Selasky wrote:
> Hi,
>=20
> In my opinion you should keep braces around single line if's .
>=20
> if (xxx) {
>    yyy;
> }
>=20
> This will reduce the chance of error next time you add a statement to a=
n 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,
--=20
Xin LI <delphij@delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!


--------------enig7CBE5F8D6D5880C3862BF559
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----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-----

--------------enig7CBE5F8D6D5880C3862BF559--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46DD3B97.1020205>