Worst ideas/features in programming languages?
Paul Backus
snarwin at gmail.com
Sat Nov 6 00:57:27 UTC 2021
On Friday, 5 November 2021 at 21:54:27 UTC, victoroak wrote:
> On Friday, 5 November 2021 at 21:46:35 UTC, H. S. Teoh wrote:
>>
>> @safe does not mean enforcing type constraints. It means
>> *memory* safety. The above code exhibits no memory unsafety,
>> even though constraints are violated and the output is,
>> ostensibly, wrong because of broken constraints.
>>
>>
>
> `.init` was not mentioned as breaking `@safe` just as a bad
> feature and I was answering why I think it is a bad feature.
>
> But the presence of both `.init` and @safe `void`
> initialization makes it way harder to write correct `@trusted`
> code that depends on some constraints because you can't really
> enforce them.
...which is one of the reasons we need @system variables:
https://github.com/dlang/DIPs/blob/master/DIPs/DIP1035.md
More information about the Digitalmars-d
mailing list