enforce()?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Jun 20 17:21:48 PDT 2010


On 06/20/2010 06:18 PM, Vladimir Panteleev wrote:
> On Mon, 21 Jun 2010 00:17:28 +0300, Walter Bright
> <newshound2 at digitalmars.com> wrote:
>
>> An input to a dll is user input, and should be validated (for the sake
>> of security, and other reasons). Validating it is not debugging.
>
> I don't understand why you're saying this. Security checks in DLL
> functions are pointless, for the reasons I already outlined:
[snip]

I think the matter is simpler than that. Essentially DbC is modular 
integrity checking. If Phobos enforce()s parameters in calls, then it 
considers its own integrity a different matter than the integrity of the 
application it's used with.

If Phobos used contracts to validate parameters, it would directly share 
responsibility for the integrity of the entire application. That way, 
users will not be sure whether the failure is a bug in Phobos or one in 
their own code.


Andrei


More information about the Digitalmars-d mailing list