Rant after trying Rust a bit

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 25 00:08:47 PDT 2015


On Saturday, 25 July 2015 at 00:28:19 UTC, Walter Bright wrote:
> On 7/24/2015 3:07 PM, Jonathan M Davis wrote:

> D has done a great job of making unit tests the rule, rather 
> than the exception.

Yeah. I wonder what would happen with some of the folks that I've 
worked with who were anti-unit testing if they were programming 
in D. It would be more or less shoved in their face at that point 
rather than having it in a separate set of code somewhere that 
they could ignore, and it would be so easy to put them in there 
that it would have to be embarrassing on some level at least if 
they didn't write them. But they'd probably still argue against 
them and argue that D was stupid for making them so prominent... 
:(

I do think that our built-in unit testing facilities are a huge 
win for us though. It actually seems kind of silly at this point 
that most other languages don't have something similar given how 
critical they are to high quality, maintainable code.

>> We should be ashamed when our code is not as close to 100% 
>> code coverage as is
>> feasible (which is usually 100%).
>
> Right on, Jonathan!

I must say that this is a rather odd argument to be having 
though, since normally I'm having to argue that 100% test 
coverage isn't enough rather than that code needs to have 100% 
(e.g. how range-based algorithms need to be tested with both 
value type ranges and reference type ranges, which doesn't 
increase the code coverage at all but does catch bugs with how 
save is used, and without that, those bugs won't be caught). So, 
having to argue that all code should have 100% code coverage (or 
as close to it as is possible anyway) is kind of surreal. I would 
have thought that that was a given at this point. The real 
question is how far you need to go past that to ensure that your 
code works correctly.

- Jonathan M Davis


More information about the Digitalmars-d mailing list