On Fri, Nov 13, 2009 at 11:39 PM, David Turnbull <dsturnbull / gmail.com> wrote:
> On 14/11/2009, at 15:21, James Edward Gray II <james / graysoftinc.com> wrote:
>>>
>>> Even Apps Hungarian is not a great idea in OO code.  ¨Βξστεαδκυστ υσ>>> the type system, so that distance would be a Kilometer object and
>>> correction would be a Foot object.  ¨Βιμονετες®«¨ζοοτ© γουμτθεξ ειτθες
>>> raise an exception or invoke a conversion.
>>
>> I would like to see us move away from considering classes to be types at
>> all in Ruby.  ¨Βθο λξοχχθατ νοδυμεαξ οβκεγτ θανιψειξτο ιτ αξχθ>> knows what singleton methods are defined on it.  ¨Β γμασσ¬ χθιγισ χθατ
>> people traditionally take for the type, is just one piece of an object's
>> identity.
>
> I would still look immediately to the class of the object in order to find
> out what it's supposed to do. From there, the class definition will probably
> list it's module inclusions prominently.

I've long (since at least 18 years) been an advocate of divorcing the
notion of type from class in dynamically typed languages:

http://talklikeaduck.denhaven2.com/files/TypesFromTheClientsViewpoint.PDF

IMHO, viewing a variable as a 'role' to be filled with one or more
objects is a powerful technique.

Alastair Cockburn recently told me that he still refers clients to the
reference paper, which I wrote at IBM, when he and l were both there.

The view fits into a general approach to OO design which is called
"responsibility based" or "role based" design.  Rebecca Wirfs-Brock
was one of the authors who published books on the approach

http://www.amazon.com/Rebecca-Wirfs-Brock/e/B001IQXNWC/ref=ntt_athr_dp_pel_1

This was before the static-typing crowd (starting with C++) took over
the conventional wisdom as to what it meant to be OO, in turn leading
to a proliferation of "methodologies" using static typing.

Those of us in the dynamic typing/roles/responsibility based community
see this as an unfortunate parallel to Gresham's Law.

With the re-birth of interest in dynamically typed languages I think
that the role based view is preferable.

-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale