Difference between revisions of "Phobos coding conventions"

From D Wiki
Jump to: navigation, search
(stub)
 
m
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
If you're planning to submit [[Pull Requests|pull requests]] for druntime or Phobos, you should follow the following coding conventions:
+
The official coding style guide can be found here: http://dlang.org/dstyle.html
 
 
* Avoid using the tab character.
 
* Use 4-space indentation.
 
* For blocks enclosed by curly braces ({}), the opening brace should be on its own line, at the same indentation level as its containing block:
 
<syntaxhighlight lang="d">
 
void main(string[] args)
 
{
 
    if (args.length == 0)
 
    {
 
        writeln("Please specify filename");
 
    }
 
    else
 
    {
 
        lotsOfDotDotDotMagic(args);
 
    }
 
}
 
</syntaxhighlight>
 

Latest revision as of 16:59, 24 December 2012

The official coding style guide can be found here: http://dlang.org/dstyle.html