New D coding convention style guide (brace formatting)

Bruno Medeiros brunodomedeiros+spam at com.gmail
Mon Aug 21 06:30:22 PDT 2006


Walter Bright wrote:
> 
> http://thc.segfault.net/root/phun/unmaintain.html
>  From - Mon

Speaking of which (but seriously), we may not get a consensus on tabs, 
and maybe justifiedly so, but one other thing with DMD's coding 
convention that troubles me is the braces formatting:

     if (b)
     {    dg();
     return true;
     }

... whoa :/ . Where did that come from? It's unusual (I personally have 
never seen C-family code formatted that way), and seems awkward to me. 
How about:

     // BSD/Allman style
     if (b)
     {
     dg();
     return true;
     }

or (my preference) :
     // K&R style
     if (b) {
         dg();
         return true;
     }
?



More information about the Digitalmars-d-announce mailing list