@trust is an encapsulation method, not an escape

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 6 12:00:35 PST 2015


On 2/6/15 11:53 AM, Steven Schveighoffer wrote:
>
> I think your strawman is overstated. The "doomsday" is the current
> situation to which you and Walter have objected.

I see that just as: code in poor style made its way in Phobos. It 
doesn't improve anything (e.g. didn't find bugs in std.file.read) and is 
just a net negative resulting from the corrupted use of a feature.

There's no completely automated protection against poor style.

> If you think having
> "better discipline" in reviews is going to fix it, I guess we will have
> to wait and see what the evidence eventually does show. There isn't
> evidence that either solution has worked, because neither has been
> employed yet.
>
> Logically, it makes sense to me that we should adjust how @trusted
> operates to prevent preventable problems that you have identified. But
> we can just keep the status quo and rely on manual process improvements
> instead.
>
> It's not terribly important to fix it right now, we can try your way
> first, I don't see how adjusting the meaning of @trusted in the future
> would be any more disruptive than it would be now.
>
> If this is how it is to be, can we get some guidelines as to what should
> and should not pass review for @trusted?

Wise words. Walter has a PR on docs, you may want to review it: 
https://github.com/D-Programming-Language/dlang.org/pull/890


Andrei


More information about the Digitalmars-d mailing list