Python 1.6 The balanced language

Alex Martelli aleaxit at yahoo.com
Fri Sep 1 03:50:08 EDT 2000


"Darren New" <dnew at san.rr.com> wrote in message
news:39AE8B3E.E90A667F at san.rr.com...
> Neel Krishnaswami wrote:
> > No, the distinguishing features of OO are that a) subtyping exists,
> > and b) the types of objects are used to do dynamic dispatch.
>
> Alan Kay argues that garbage collection is necessary as well. Which makes
> sense, since otherwise you have to know the implementation of the class to
> know when it's safe to collect some reference you passed to the class
> earlier.

Actually, I need to know the *interface semantics*, not the way the
class chooses to implement it.  And garbage collection does not save
me the need to specify & understand those interface semantics.

In a language where objects can be mutable, it's semantically crucial
to know whether a certain class is allowed to keep a reference that
is passed to it: it determines whether I can freely call modifier
methods on that reference later, without side-effects on the "certain
class"'s behaviour, or whether I have to ask for copies (or deep
copies) for the purpose.

So, this needs to be specified anyway, quite apart from the "safe
to collect" issue; it's a more general question of whether it's
safe to *alter* objects through certain references ("collecting"
being just one way to perform such alterations, albeit a very
particular one).

Garbage collection may be a very desirable feature (and we can
keep talking on the neverending issues of mark-&-sweep and its
variants versus the precisely-timed-finalization enabled by
reference counting & its costs, ad nauseam) but tying the "OO"ness
of a language to it seems to be a typical case of "hidden agenda"
(I want to "sell" concept A to an audience that's all fired up on
concept B, so, I try to make it appear as if B needs/implies A).

"subtyping exists" is another contentious issue, of course; if I
removed "extends" from Java, requiring all polymorphous use to
go through "interface" and "implement" (as, e.g., Coad has suggested
as best design practice), would I "totally lose OO-ness"?  Are
languages based on 'prototype objects' (with no classes at all)
"not OO"?  Pah...


Alex






More information about the Python-list mailing list