How does D improve design practices over C++?

Denis Koroskin 2korden at gmail.com
Wed Oct 29 05:18:43 PDT 2008


On Wed, 29 Oct 2008 08:53:47 +0300, Janderson <ask at me.com> wrote:

> Hi,
>
> I was talking with some collages at work and they asked me how D  
> enforces good programming practices.   For course I mentioned a couple  
> of the ones I knew of hand -
>
> - Unit checking
> - Design by contract
> - Invariant checks
> - Stronger const
> - Modules
> - Garbage collection
> - No automatic copy constructor
> - More restrictive operators
> - Delegates (Specifically, encouraging there use by making them simple  
> to use)
> - Specific constructs such as Interfaces
> - More restrictive casting
> - No C style Macros
>
> I'm sure I've missed a lot in this area.  I'd like to email them a good  
> list of "good coding design" that D promotes through syntax.  Note: The  
> C++ verse D page is not what I'm looking for.  I'm more interested in  
> coding practices then anything else.  For instance things that you can  
> mess up in C++ but D won't let you.
>
> Cheers
> -Joel

// The following is a valid C/C++ but not valid D (note the semicolon)
for (int i = 0; i < 100; ++i);
     printf("%d", i);



More information about the Digitalmars-d mailing list