Blogpost about the T.init problem

Meta jared771 at gmail.com
Tue Jul 10 21:06:31 UTC 2018


On Tuesday, 10 July 2018 at 13:41:56 UTC, FeepingCreature wrote:
> I've written up a short blogpost about the T.init issue.
>
> It is not very enthusiastic.
>
> https://medium.com/@feepingcreature/d-structs-dont-work-for-domain-data-c09332349f43
>
> Related links:
>
> https://github.com/dlang/phobos/pull/6594 problem with T.init 
> and toString
>
> https://github.com/dlang/phobos/pull/6619 Nullable can't work 
> with types where T.init violates invariants
>
> https://github.com/dlang/dmd/pull/8462 A somewhat sketchy PR to 
> disable invariant on struct ~this

D's contract programming features have been around since D1 and 
haven't really been updated to work with newer D2 features (this 
is no excuse IMO; these issues should have been addressed long 
ago).

My opinion is that it's a vicious circle; D's contract 
programming features are underutilized, thus nobody cares enough 
to put effort into ironing out the bugs, thus contract 
programming in D is buggy and interacts poorly with other 
language features, thus D's contract programming features are 
underutilized.

IMO, if you don't have the knowledge, desire, or time to fix 
them, the next best thing to do is write articles like these 
bringing some attention to the various defects of contract 
programming in D, and/or write DIPs to propose ways to fix it.


More information about the Digitalmars-d-announce mailing list