[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

to use braces or not? (was: Re: [PATCH]: A newer, better, svndiff)

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-02-20 01:47:28 CET

On Thu, Feb 14, 2002 at 10:44:41PM -0500, Greg Hudson wrote:
> On Thu, 2002-02-14 at 19:20, Daniel Berlin wrote:
>...
> > + if (cache)
> > + {
> > + svn_pool_destroy (cache->pool);
> > + }
>
> We don't generally put braces around a single-line body of a control
> statement.

Actually, I don't believe there is a prevailing opinion one way or another
for this. Some of us tend to keep them in there, in case future changes need
them. Others tend to skip the braces.

I usually like to keep them in if that following line is anything beyond the
most simple of lines. Even though there may be a single statement, if there
is a comment, then I'll always add the braces. Control flow changes, such as
SVN_ERR(), will always cause me to add braces.

etc.

I'd say that it is personal preference at this point, with a mild nod
towards the style (if obvious) that prevails in the given file.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:09 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.