[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Interfaces in Ruby
From:       Nat Pryce <nat.pryce () b13media ! com>
Date:       2002-10-18 18:08:32
[Download RAW message or body]

On Fri, 2002-10-18 at 18:03, Paul Brannan wrote:
> On Fri, Oct 18, 2002 at 11:20:43PM +0900, Nat Pryce wrote:
> > On Fri, 2002-10-18 at 14:42, Paul Brannan wrote:
> > > The intent of an interface is not to cerfity a particular behavior.  It
> > > is to certify that the author's intent is for the class to have a
> > > particular behavior.
> > 
> > Isn't that the point of comments and/or documentation.  I'd argue that
> > if the only point of an interface is to act as a comment, then it should
> > be left as as a comment. 
> 
> There are some days that I agree.
> 
> There are other days when I feel that it would be useful to
> programatically determine what the author's intent was for a class.
> This is something that is difficult to do with comments alone.

That's true, but interfaces don't help you, and DbC only gets you part
way there.  Also, in my experience, DbC ends up polluting the class
interface with a lot of predicates, because it doesn't support the idea
of protocols, and makes changing code very difficult because contracts
are duplicated throughout the code.  Something similar to type inference
might help in the latter case.

Cheers,
	Nat.
 
-- 
Dr. Nathaniel Pryce, Technical Director, B13media Ltd.
Studio 3a, 22-24 Highbury Grove, London N5 2EA, UK
http://www.b13media.com



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic