coding standard for D progrimming language

Jonathan M Davis jmdavisProg at gmx.com
Wed Mar 13 21:15:23 PDT 2013


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


More information about the Digitalmars-d-learn mailing list