www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - coding standard for D progrimming language

reply "AngryLemming" <artem.3a gmail.com> writes:
Hello everybody.

Do you know any coding standards and code formatting 
recommendations for D? I want to find something like PEP8 for 
Python or Code Formatting Guidelines for F# and C#.

With best regards, AngryLemming
Mar 13 2013
parent reply "bearophile" <bearophileHUGS lycos.com> writes:
AngryLemming:

 Do you know any coding standards and code formatting 
 recommendations for D?
http://dlang.org/dstyle.html Bye, bearophile
Mar 13 2013
parent reply "AngryLemming" <artem.3a gmail.com> writes:
On Thursday, 14 March 2013 at 03:43:03 UTC, bearophile wrote:
 http://dlang.org/dstyle.html

 Bye,
 bearophile
I read this, but this document is very small and without some important question's. For example: interface ISome ... or interface Some ... ... int foo() { or int foo() ... { } ... } ... void foo(int a, int b, int c) or void foo(int a, ... int b, int c) ... etc... I want to find something like PEP8.
Mar 13 2013
parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Thursday, March 14, 2013 04:55:14 AngryLemming wrote:
 On Thursday, 14 March 2013 at 03:43:03 UTC, bearophile wrote:
 http://dlang.org/dstyle.html
 
 Bye,
 bearophile
I read this, but this document is very small and without some important question's. For example: interface ISome ... or interface Some ... ... int foo() { or int foo() ... { } ... } ... void foo(int a, int b, int c) or void foo(int a, ... int b, int c) ... etc... I want to find something like PEP8.
We have no such standard. It's up to you. The closest would be that Phobos uses BSD Allman style braces (i.e. braces go on the same line). Most of what we care about is the naming guidelines, because that affects the API, and those are on the http://dlang.org/dstyle.html page. We quite specifically don't have much in the way of requirements on formatting guidelines. The main rule of thumb is that modules should be consistent, but that says nothing about what the formatting style is, just that it's followed consistently. - Jonathan M Davis
Mar 13 2013