Structs are Not Plain: A call for empty struct constructors

FeepingCreature feepingcreature at gmail.com
Fri Sep 20 07:58:42 UTC 2019


On Friday, 20 September 2019 at 07:48:25 UTC, Dukc wrote:
> But in fact, most of D stuff has "null" anyway: floats, chars, 
> arrays, pointers, classes regardless of the definition. Only 
> bools, integrals and enums (if you don't define one) do not, 
> none of which are complex types. The philosophy AFAIK is that a 
> type should always provide a null value, if it can be assigned 
> normally "wrong" values without enlarging it.

Yeah and I don't much approve of all that either... how many 
unexpected crashes can be laid at the feet of objects being 
"segfault by default"? You're argument is basically "that's how 
it is, so that's how it should be." The proliferation of non-null 
invariants in our codebase begs to disagree.


More information about the Digitalmars-d mailing list