How does D improve design practices over C++?

Janderson ask at me.com
Wed Nov 5 19:38:38 PST 2008


Christopher Wright wrote:
> Janderson wrote:
>> Tony wrote:
>>  > "Janderson" <ask at me.com> wrote in message 
>> news:gepsn2$21jr$1 at digitalmars.com...
>>  >> Tony wrote:
>>  >>> Let me be facetious with Janderson's list plz...
>>  >>>
>>  >>> "Janderson" <ask at me.com> wrote in message 
>> news:ge8tpd$1f6b$1 at digitalmars.com...
>>  >>>> 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
>>  >>> Not sure what is meant by this, but it sounds minor.
>>  >> Sure C++ can do unit checking, but its not built in.  You have to 
>> use macros or templates in something that is not really designed to 
>> work correctly with the language.  Even if you ignore that there's a 
>> barrior to entry by not having something like this in the language.  
>> By having it in the language good coding practices are encouraged.
>>  >
>>  > I write unit tests. I don't know why I'd need or want language 
>> support for that.
>>
>>
>> What api do you use?  All the api's I've used are not as nice as the 
>> built in one for D.
> 
> This is a joke, right?
> 
> The code you need to write for a unittest is a lot smaller for D's 
> builtin unittests than for any other testing system I've seen. That's 
> the only category in which D's unittests win.
> 
> This is mostly the fault of the unittest runners in Tango and Phobos, 
> I'd wager, but you still won't be able to name unittests without 
> changing the compiler, and that's a major issue, in my opinion.


That's a good point.  I've never really used the advanced unit-test 
features of other unit test programs.  All I really used was sets of 
tests which I could run automatically.  D provides this without all the 
rest of the cruft that comes along with the api's I've used.   Note I'm 
referring to implementation details not features.  For small projects 
I'm not going to go out of my way to install unit-tests but having them 
already there means that I can still use them.

-Joel



More information about the Digitalmars-d mailing list