Thread overview | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 20, 2006 New D coding convention style guide | ||||
---|---|---|---|---|
| ||||
http://thc.segfault.net/root/phun/unmaintain.html |
August 20, 2006 Re: New D coding convention style guide | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
>
> http://thc.segfault.net/root/phun/unmaintain.html
Some good advice on tab-usage there:
"Never underestimate how much havoc you can create by indenting with tabs instead of spaces, especially when there is no corporate standard on how much indenting a tab represents. Embed tabs inside string literals, or use a tool to convert spaces to tabs that will do that for you."
|
August 20, 2006 Re: New D coding convention style guide | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Sat, 19 Aug 2006 20:03:35 -0400, Walter Bright <newshound@digitalmars.com> wrote:
> http://thc.segfault.net/root/phun/unmaintain.html
I'll begin converting my code...
|
August 21, 2006 Re: New D coding convention style guide (brace formatting) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | 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;
}
?
|
August 21, 2006 Re: New D coding convention style guide (brace formatting) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bruno Medeiros | Bruno Medeiros wrote: > 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 It sure is! > (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; > } > ? No, No! Everyone knows it should really be: if(b) { dg(); return true; } ;) :P |
August 21, 2006 Re: New D coding convention style guide (brace formatting) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bruno Medeiros | Bruno Medeiros wrote:
> 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.
It's just:
if (b)
{
dg();
return true;
}
compressed to save precious vertical screen space.
|
August 21, 2006 Re: New D coding convention style guide (brace formatting) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
> Bruno Medeiros wrote:
>
>> 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.
>
>
> It's just:
>
> if (b)
> {
> dg();
> return true;
> }
>
> compressed to save precious vertical screen space.
... get a flat-panel that can be rotated into portrait mode. The 24" Dell displays more lines of code (in portrait orientation) than you can shake a stick at :)
|
August 21, 2006 Re: New D coding convention style guide (brace formatting) | ||||
---|---|---|---|---|
| ||||
Posted in reply to kris | kris wrote:
> ... get a flat-panel that can be rotated into portrait mode. The 24" Dell displays more lines of code (in portrait orientation) than you can shake a stick at :)
There's never enough screen real estate (but I now can't imagine working on 24 line displays like I used to).
|
August 21, 2006 Re: New D coding convention style guide (brace formatting) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
> kris wrote:
>
>> ... get a flat-panel that can be rotated into portrait mode. The 24" Dell displays more lines of code (in portrait orientation) than you can shake a stick at :)
>
>
> There's never enough screen real estate (but I now can't imagine working on 24 line displays like I used to).
likewise
|
Copyright © 1999-2021 by the D Language Foundation