[plt-scheme] planet: help submitting bugs & a question

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Sep 2 09:56:57 EDT 2008

On Sep 2, 2008, at 9:16 AM, Robby Findler wrote:

>> Will it also drive home another dynamic of contracts?  I might be
>> misunderstanding, but, if code in package B accepts invalid input  
>> from
>> package A and passes it through to package C, will the developer  
>> of package
>> B then be getting annoying bug reports until s/he adds contracts  
>> to put the
>> blame on package A (or input checks to error-out before a contract  
>> violation
>> happens)?
> No, contracts will continue to work properly. :)

Neil, let me try to clarify this answer.

Short: Yes, package B will be blamed for calling C's functions with  
bad inputs.
If the author of B doesn't want to be blamed for such things, his  
package needs
contracts that defend B against A.

Long: This is in a sense the goal of the effort. Our hypothesis is that
contract-blame is viral. It used properly, it leads to defensive
efforts at the right level. As Meyer pointed out, defensive programming
per se is bad. It obscures the interface of methods and functions.  
contracting, however, is a good idea. It explicates what functions  
and methods
are able to consume and what they can't cope with it at the level  
that 3rd
party developers must understand to use a package.

-- Matthias

Posted on the users mailing list.