www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DMD coding style rules?

reply "asman" <lol.themask gmail.com> writes:
is there? if so, where is it? Also, I see dmd is written in C++ 
but still uses C style to do stuff eg, printf() instead of cout. 
Is this why C++ libraries can increase a lot size (and 
performance?) of executable which current style don't?
Apr 16 2014
next sibling parent reply "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"asman"  wrote in message news:maojdlxhbwuhxqrmvvjf forum.dlang.org...

 is there? if so, where is it? Also, I see dmd is written in C++ but still 
 uses C style to do stuff eg, printf() instead of cout. Is this why C++ 
 libraries can increase a lot size (and performance?) of executable which 
 current style don't?
There are no formal rules that I'm aware of (unless somebody added them to the wiki) but the (frontend) code is fairly consistent. The C-ish style is mostly due to age and Walter's preferences. This has turned out to be a huge advantage as it makes conversion to D much easier than C++-style code with heavy stl usage etc.
Apr 16 2014
parent reply "asman" <lol.themask gmail.com> writes:
On Wednesday, 16 April 2014 at 13:57:33 UTC, Daniel Murphy wrote:
 "asman"  wrote in message 
 news:maojdlxhbwuhxqrmvvjf forum.dlang.org...

 is there? if so, where is it? Also, I see dmd is written in 
 C++ but still uses C style to do stuff eg, printf() instead of 
 cout. Is this why C++ libraries can increase a lot size (and 
 performance?) of executable which current style don't?
There are no formal rules that I'm aware of (unless somebody added them to the wiki) but the (frontend) code is fairly consistent. The C-ish style is mostly due to age and Walter's preferences. This has turned out to be a huge advantage as it makes conversion to D much easier than C++-style code with heavy stl usage etc.
Thanks very much. In this case I can assume there's no std:: stuff and it isn't allowed, correct?
Apr 18 2014
next sibling parent "asman" <lol.themask gmail.com> writes:
On Saturday, 19 April 2014 at 01:50:17 UTC, asman wrote:
 On Wednesday, 16 April 2014 at 13:57:33 UTC, Daniel Murphy 
 wrote:
 "asman"  wrote in message 
 news:maojdlxhbwuhxqrmvvjf forum.dlang.org...

 is there? if so, where is it? Also, I see dmd is written in 
 C++ but still uses C style to do stuff eg, printf() instead 
 of cout. Is this why C++ libraries can increase a lot size 
 (and performance?) of executable which current style don't?
There are no formal rules that I'm aware of (unless somebody added them to the wiki) but the (frontend) code is fairly consistent. The C-ish style is mostly due to age and Walter's preferences. This has turned out to be a huge advantage as it makes conversion to D much easier than C++-style code with heavy stl usage etc.
Thanks very much. In this case I can assume there's no std:: stuff and it isn't allowed, correct?
I understood there's no formal rules but I mean, Walter will not like use these stuff
Apr 18 2014
prev sibling parent "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"asman"  wrote in message news:ktcpixnpmessxamqelmh forum.dlang.org...

 Thanks very much. In this case I can assume there's no std::
 stuff and it isn't allowed, correct?
Yes. If you started using namespaces, stl, etc it would break DDMD so it's essentially banned now.
Apr 18 2014
prev sibling next sibling parent Daniel =?ISO-8859-2?B?S2964Ws=?= via Digitalmars-d writes:
V Wed, 16 Apr 2014 13:32:45 +0000
asman via Digitalmars-d <digitalmars-d puremagic.com> napsáno:

 is there? if so, where is it?
http://dlang.org/dstyle.html
Apr 16 2014
prev sibling parent reply Daniel =?ISO-8859-2?B?S2964Ws=?= via Digitalmars-d writes:
V Wed, 16 Apr 2014 13:32:45 +0000
asman via Digitalmars-d <digitalmars-d puremagic.com> napsáno:

 is there? if so, where is it?
sorry I post coding styles for D not for dmd
Apr 16 2014
parent "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"DanielKozákvia Digitalmars-d"  wrote in message 
news:mailman.99.1397656987.2763.digitalmars-d puremagic.com...

 sorry I post coding styles for D not for dmd
They are similar.
Apr 16 2014