DIP1028 - Rationale for accepting as is

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed May 27 15:45:22 UTC 2020


On Wednesday, 27 May 2020 at 13:47:46 UTC, Claude wrote:
> On Wednesday, 27 May 2020 at 13:42:08 UTC, Andrej Mitrovic 
> wrote:
>> Is the actual problem those `@trusted:` declarations at the 
>> top of C headers?
>>
>> There could be a simple solution to that:
>>
>> Ban `@trusted:` and `@trusted { }` which apply to multiple 
>> symbols. Only allow `@trusted` to apply to a single symbol. For
>
> IMO, it makes things worse. Because the careless programmer 
> will slap @trusted to every declaration (maybe with a script or 
> find/replace macro of his editor). So now, we don't know if the 
> annotation is greenwashing or careful examination of the 
> definition.

The difference is when adding new symbols. If version control is 
used, it would be very obvious in a review whether a new @trusted 
symbol was added or not. A diff typically shows several lines of 
context, and a toplevel `@trusted:` is easy to miss.


More information about the Digitalmars-d-announce mailing list