[phobos] phobos commit, revision 2098

Steve Schveighoffer schveiguy at yahoo.com
Tue Jan 4 07:35:17 PST 2011


I prefer no full bracing, and braces on their own line.

The only thing I'd say is that bracing is required on nesting.  i.e. this is ok:

if(x)
   blah();
else
   bleh();

but this is not:

if(x)
   if(y)
      blah();
   else
      bleh();

should be:

if(x)
{
   if(y)
     blah();
   else
     bleh();
}


-Steve

----- Original Message ----
> From: Andrei Alexandrescu <andrei at erdani.com>
> To: Discuss the phobos library for D <phobos at puremagic.com>
> Sent: Mon, January 3, 2011 10:38:25 PM
> Subject: Re: [phobos] phobos commit, revision 2098
> 
> I think the occasional no full bracing is less of an issue than brace on 
> its  own line. And we should observe that stuff for new code - for the 
> time being  there's no need to go back and change everything.
> 
> Andrei
> 
> On 1/3/11  9:32 PM, Jonathan M Davis wrote:
> > On Monday 03 January 2011 17:05:58  Andrei Alexandrescu wrote:
> >> David, I see some of the code you  committed uses a different bracing
> >> convention than the existent one.  I don't blame you as I myself
> >> sometimes forget and use the  convention at work when committing into
> >>  Phobos.
> >>
> >> Going forward, do we all agree to go with full  bracing and brace on its
> >> own line?
> >
> > I cringe to think  of how many useless braces I'll have to add to 
>std.datetime to
> > have  "full" bracing, but if we want to use that as a convention, then tough  
>luck
> > for me. Personally, I hate full bracing (though I definitely prefer  the 
>braces on
> > their own line), but it's not like you're ever going to  get everyone to 
>agree on
> > formatting. So, just pick something that you  think is reasonable, and 
>hopefully
> > we'll remember to code that  way.
> >
> > - Jonathan M Davis
> >  _______________________________________________
> > phobos mailing  list
> > phobos at puremagic.com
> >  http://lists.puremagic.com/mailman/listinfo/phobos
> _______________________________________________
> phobos  mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
> 


      


More information about the phobos mailing list