Rant after trying Rust a bit
Tobias Müller via Digitalmars-d
digitalmars-d at puremagic.com
Sat Jul 25 11:58:45 PDT 2015
Walter Bright <newshound2 at digitalmars.com> wrote:
> On 7/23/2015 12:50 PM, Tobias Müller wrote:
>> TBH I'm very surprised about that argument, because boolean conditions with
>> version() were dimissed for exactly that reason.
>
> I knew someone would bring that up :-)
>
> No, I do not believe it is the same thing. For one thing, you cannot test
> the various versions on one system. On any one system, you have to take
> on faith that you didn't break the version blocks on other systems.
>
> This is quite unlike D's template constraints, where all the combinations
> can be tested reliably with a unittest{} block.
How is this related to testability? Using boolean conditions does not
introduce any new code paths compared to helper versions/ helper traits.
Testability is exactly the same.
My point was that you argued with cleaner design in the case of versions.
*I agree with that*, and I think the same is true for traits.
Even if you're right and testability is better, that doesn't contradict the
point that I'm trying to make.
Tobi
More information about the Digitalmars-d
mailing list