enforce()?

Vladimir Panteleev vladimir at thecybershadow.net
Mon Jun 21 18:35:44 PDT 2010


On Mon, 21 Jun 2010 21:15:12 +0300, Adrian Matoga <epi at atari8.info> wrote:

> It was 15 years ago, at the times of 3.x and 95, when Windows behaved  
> like that.

More like 10, Windows Millennium was the last 9x-based Windows operating  
system without strong process isolation.

> The problem applies not only to Windows, but any API you would imagine.
> A common situation is when you need to do your job quickly using only  
> some part of a library which otherwise you aren't going to study  
> thoroughly, or you want only a proof-of-concept. And if your attempting  
> to use something new to you, you do make mistakes, no matter how you are  
> convinced yo do not.
> If the API is defined not by documentation (which is often a tissue of  
> lies, and hardly ever it's unambiguous), but by means of input checking,  
> you have benefits in two fields: 1) developers of library had to think  
> what they wanted to do, so library probably works, and it's less  
> probable that its new versions will break the compatiblity, and 2) users  
> of the library will be warned quickly, saving their time.
>
> It's not about messing other processes. It's about saving your time,  
> otherwise consumed by effects of common mistakes, misunderstanding the  
> documentation, or working in a hurry. And your time costs much more than  
> the time of bazillion argument checks.

For this particular situation, contracts would be just fine though :)

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


More information about the Digitalmars-d mailing list