enforce()?

Vladimir Panteleev vladimir at thecybershadow.net
Mon Jun 21 18:32:22 PDT 2010


On Mon, 21 Jun 2010 16:30:48 +0300, Leandro Lucarella <luca at llucax.com.ar>  
wrote:

> Andrei Alexandrescu, el 21 de junio a las 08:02 me escribiste:
>> On 06/20/2010 11:08 PM, Leandro Lucarella wrote:
>> >Walter Bright, el 20 de junio a las 19:32 me escribiste:
>> >>Leandro Lucarella wrote:
>> >>>Why will you assume I'm so dumb that I won't use your
>> >>>interface correctly?
>> >>
>> >>Windows has had major legacy compatibility issues because critical
>> >>third party applications misused the APIs.
>> >>
>> >>People *will* misuse your API, and you will get blamed for it. It's
>> >>unfair, but that's how it works.
>> >
>> >Luckily I haven't used Windows for about 10 years now =)
>> >
>> >It's really a shame that D will take the stupidity route.
>> >
>> >PS: I don't know how windows work, but if calling the Windows API is
>> >     like going into kernel mode, and you can mess other processes, it
>> >     seems reasonable to do check every API call as if it were user
>> >     input, but if you're confined to your process, is really stupid.
>>
>> Why is it stupid?
>
> Because you're adding unnecessary extra checks, just based on
> (Windows?) programmer's stupidity.

Walter makes a good point. If someone uses your API in the wrong way and  
relies on undocumented/undefined behavior, you'll end up having to support  
this usage pattern in future implementations of your interface if you want  
businesses and other entities who depend on that product to buy your new  
operating system.

-- Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d mailing list