--- chromatic <[EMAIL PROTECTED]> wrote:

> Given:
> 
>       my $result = $thingie.bark;
> 
> ... where $thingie may be a Dog or $thingie may be a Tree, is "bark"
> a noun or a verb?
> 
> Sure, it's a lousy example, but remember the immutable law of OO
> didactics: 
> all examples must be terrible.

As a perhaps slightly better example:

  if $object.read { ... }

Implemented as:

  method read ( --> Boolean ) { ... }

(How do I specify no args and a Boolean return type?)

Are we successfully 'read'ing  from a pip, or is the logfile read into
memory?  Each of those might take no arguments and have a boolean
return type.  The latter *should* have a method name like 'is_read',
but it's easy in the heat of the deadline to write bad method names.

In this case, we have two conceptually similar methods called on
different objects.  This is the false cognate problem.  At its core,
you have no syntactic difference and reflection can't tell you that
these are radically different.

The only difference is semantic, and that's what the programmer has to
provide.  Otherwise, we're all out of jobs :)

Cheers,
Ovid

--
Buy the book  - http://www.oreilly.com/catalog/perlhks/
Perl and CGI  - http://users.easystreet.com/ovid/cgi_course/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog     - http://use.perl.org/~Ovid/journal/

Reply via email to