[Issue 14125] @trusted nested helper functions in std.file

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 4 22:13:24 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14125

--- Comment #65 from Dicebot <public at dicebot.lv> ---
(In reply to Andrei Alexandrescu from comment #62)
> I don't see how this is pushing your argument further. Make a technical
> point and it'll be well appreciated.

Big chunks of @trusted are maintenance disaster. @trusted completely disabled
all compiler safety verification and because of that every time a single line
changes in @trusted function it must be completely re-evaluated as a whole
during the review to ensure that safety promise stays. Situation becomes worse
because compiler is very conservative in what it considers reliably @safe and
thus amount of necessary at trusted functions is very big. Combined, that makes
using @trusted in a way you propose so impractical that resource-wise it is
more effective to completely ignore @safe feature at all - it does not provide
enough benefits for such investment.

Does that sounds technical enough?

> > @trusted functions longer than few lines are inherently unmaintainable
> > unless implementation is supposed to be read-only (like with bindings).
> > Saying "no, you don't really have the problem" doesn't make it go away.
> > Especially when I have already tried approach you suggest and experienced
> > how it fails in practice.
> 
> I see the good code in std.file has gone bonkers.

I hope _this_ is not your understanding of a "technical point" ;)

--


More information about the Digitalmars-d-bugs mailing list