From: pcg@aber.ac.uk (Piercarlo Grandi)
Newsgroups: comp.object,comp.software-engineering
Subject: Heresy discomfited!
Date: 12 Sep 92 20:45:48 GMT
	<PCG.92Aug9202050@aberdb.aber.ac.uk>
	<1992Aug10.125051.28591@m.cs.uiuc.edu>
Reply-To: pcg@aber.ac.uk (Piercarlo Grandi)
Organization: Prifysgol Cymru, Aberystwyth
X-Old-Subject: Re: O.M() versus M(O) notation

On 10 Aug 92 12:50:51 GMT, johnson@m.cs.uiuc.edu (Ralph Johnson) said:

pcg> Well, let's try: if OO is not about decomposition/reclustering
pcg> strategy to develop systems, what's it?

pcg> Surely it is not about message passing, or dynamic dispatching.
pcg> These are present, and let me add in massive and well developed
pcg> doses, in languages based on other paradigms.  Indeed OO languages
pcg> are not based on message passing as a rule, and many have dynamic
pcg> dispatching only as an option (e.g. Simula 67, C++), and some don't
pcg> have it at all. And so on for other language features.

johnson> But other systems cluster operations with data, and they are
johnson> not all object-oriented.  Ada does, and isn't.

Ada does not directly support clustering implementations that are
related by their operating on the same representation. One can put any
implementation with any representation in an Ada package. Ada is said to
support as decomposition paradigm modularization in general, a weaker
decomposition paradigm than ADT, which is a weaker decomposition
paradigm than OO.

johnson> CLOS doesn't, and is.

Most definitely CLOS *does* cluster implementations by way of their
operating on the same representation. After all it does have a defclass
idiom, doesn't it? Naturally it is more general than traditional OO, in
that it supports multimethods, but this is just the right thing to do.

johnson> C++ with virtual functions is not object-oriented.

Because it does not support run time unlimited polymorphism, but only
the compile time variety? The fact that C++ does support directly the OO
decomposition paradigm does not count? Aw, funny. Granted, C++ is a
stilted and haphazard language, but it does directly support OO
decomposition, even if it makes it unusually unelegant.

johnson> Every single OO language includes dynamic dispatching.

But OO technology is not defined by the set of languages that more or
less imperfectly try to provide linguistic tools that support it. Or is
it?

johnson> Show me one that doesn't.

This is impossible if you define OO == dynamic dispatching. If one does
not: Mario Wolckzo last time we had this ridiculous discussion came up
with an OO language that does not have dynamic dispatching at all. And
many languages that support directly the OO decomposition paradigm have
dynamic dispatching only as an option, which is only relatively rarely
used (e.g. Simula 67).

johnson> Dynamic dispatching (or, as I call it, polymorphism by
johnson> late-binding of procedure calls)

So static polymorphism is not important? Generics and templates are not
that useful?

johnson> is crucial in REAL oo systems.

If you want to argue that dynamic overload resolution and one of its
possible consequences, dynamic polymorphism, are very useful tools and
they help immensely in building complex, evolving systems, at a
relatively small price in unsafety, that's one of my points too, and one
that is quite supported by reports in the literature; and I am on record
as suggesting that Objective C is for application programming a more
suitable language than C++ precisely for this reason.

I am also on record as writing that various levels of control and type
abstraction open up various levels of expressive power (e.g. loops are
*necessary* for navigating arrays, recursion for trees, generators for
graphs, ...). So, yes, I am all for "latent typing" (and for resolving
statically what can be, which seems to be one of the thrusts of your and
others' research in the past few years).

But the benefits of "latent typing" accrue irrespectively of whether it
is used along with an OO decomposition strategy or not; it results in
looser, dynamic coupling between modules, which is totally independent
of the programming technology used. Indeed Lisp fans have always pointed
at its latent typing as a strong advantage, in much the same way as they
point at its automatic storage reclamation.

To make latent typing an essential aspect of OO programming is about as
accurate as stating the same of automatic storage reclamation (and there
are lots of people that would agree with the latter point). After all,
virtually all OO languages also do have automatic storage reclamation,
don't they?

johnson> Let me emphasize that it is quite likely Piercarlo is NOT doing
johnson> real oo programming.

Well, I do use Smalltalk only relatively rarely, yes, maybe you are
right. Yet despite this I do as a rule:

pcg> Well, to put in the same module all procedures that operate on data
pcg> entities with the same representation.

johnson> This is object-based programming, perhaps, but not
johnson> object-oriented.

Bah. You seem to define OO on the basis of linguistic features; I define
it on the basis of which decomposition paradigm is used:

pcg> Well, let's try: if OO is not about decomposition/reclustering
pcg> strategy to develop systems, what's it?

Here you have a reply ready:

johnson> OOP has three distinguishing characteristics, in my opinion.

I take note that here you write Object Oriented Programming, not Object
Oriented Languages, and this is consistent with your whole position.

johnson> The first is the ability to define new data types, including
johnson> both representation and the operations on those data types, and
johnson> to think of the new data types just in terms of the operations
johnson> that are allowed on them.  This is the heart of ATDs, and is
johnson> supported not only by Simula, CLOS, and Self, but also by Ada
johnson> and many other non-oo languages.

This is about linguistic issues, which are so fleeting. For example, one
can do this very well in scheme (see the Abelson & Sussman primer for
examples), but scheme does not have type extension as a primitive of the
language. Does this mean that ADT programming is not possible in scheme?
Schemers are known 

johnson> The second is polymorphism by late-binding, which is supported
johnson> by all oo languages, but not by ADT languages like Ada.

Again, there are OO languages that don't support it (and Ada is not an
ADT language, it's a modular language); and most support it only as an
explicit programmer option in a very limited way. Would you argue that
Simula 67 is not a language that supports OO programming?

A few lines above you seemed to imply it is an OOP language:

johnson> This is the heart of ATDs, and is supported not only by Simula,
johnson> CLOS, and Self, but also by Ada and many other non-oo
johnson> languages.

If this means that you think that Simula 67 is an OO language, tell us
where Simula 67 does support polymorphism by late binding. Remember you
said:

johnson> C++ with virtual functions is not object-oriented.

I am curious to see how you get out of this. Either Simula 67 is not OO
in your view, or C++ is too, for Simula's support for late binding is
virtually identical to that of C++.

johnson> It is supported by a few languages like Russell,
			      ^^^
Bah. Bah and triple Bah. I suspect that "few" is a bit of a misnomer.

johnson> but there the class (called "type" in Russell) of an object is
johnson> not stored in the object itself (though it could be) but is
johnson> passed along as a separate argument.

But here I have the mistaken impression that implementation is not
separated with design. This is very strange. And even at the
implementation level there is absolutely no need for an OO language
based on classes to store the class (or a pointer or marker denoting it)
of an object in the object itself.

johnson> The third is inheritance,

Inheritance? And delegation and the other saner ways of reusing
interface and implementation? They are not OO, of course. And this third
essential aspect of OO is still a particular language feature.


I will mention a dreaded paper, the Cardelli/Wegner survey on OO (ACM
Surveys December 1985), where they write:

    "In the context of this discussion it is useful to define
    object-oriented languages as extensions of procedure-oriented
    languages that support typed data abstractions with inheritance.
    Thus we say that a language is object oriented if and only if it
    satisfies the following requirements:

     * It supports objects that are data abstractions with an interface
       of named operations and a hidden local state.
     * Objects have an associated object type.
     * Types may inherit attributes from supertypes."

First allow me register the comment that this is a most unfortunate
and confused definition with which I dissent vigorously.

Then, it is amazing similar in spirit to yours, which runs as:

johnson> OOP has three distinguishing characteristics, in my opinion.
johnson> The first is the ability to define new data types, [ ... ]
johnson> The second is polymorphism by late-binding, [ ... ]
johnson> The third is inheritance, [ ... ]

but while you claim that your is a definition of OOP, they claim it is a
definition of an OOL, which seems to me rather more acceptable.

Are you sure you cannot distinguish between Object Oriented Programming
and Object Oriented Languages (plus a detail of their implementation)?

A Professor of Computer Science?

Surely you must be joking. You are making fun of us all with a
caricature of the thesis "OO *Programming* is really the same as the
features of the Smalltalk language, no more, no less". Down to the
detail that in some Smalltalk implementations objects "contain" a class
pointer/denoter.


Or maybe, let me think again. Maybe you have not been joking at all, and
I am just utterly confused.

You dismiss the idea that OOP is characterized by a particular program
structuring strategy, and instead assert that OOP is characterized only
and essentially by three language and one implementation feature. You
have not written 'OOP requires these features to support its
decomposition paradigm', you have not even written 'OOP is essentially
characterized by these features, that quite incidentally also support a
peculiar decomposition paradigm'. No, in contrast and reply to my
question:

pcg> Well, let's try: if OO is not about decomposition/reclustering
pcg> strategy to develop systems, what's it?

you have quite unambiguously written:

johnson> OOP has three distinguishing characteristics, in my opinion.
johnson> The first is the ability to define new data types, [ ... ]
johnson> The second is polymorphism by late-binding, [ ... ]
johnson> The third is inheritance, [ ... ]

which does not mention decomposition paradigms at all, and added the
remark that some languages' latent typing facilities are not OO
because [in their implementation] 

johnson> [ ... ] the class (called "type" in Russell) of an object is
johnson> not stored in the object itself (though it could be) but is
johnson> passed along as a separate argument.

I have pondered this matter for weeks, and I have come to a conclusion:

These two positions are very clear, unambiguous, there is no way to
misinterpret them, and they are totally irreconcilable and opposite, one
of them must be completely bogus, and surely it must be mine, just a
misinterpretation of literature, yours is an authoritative statement by
a Professor. I have now realized that the expert on OOP is you, I am
just a dilettante, as you have noticed yourself:

johnson> Let me emphasize that it is quite likely Piercarlo is NOT doing
johnson> real oo programming.

johnson> Just because you don't understand something doesn't mean there
johnson> is no meaning in it.

Here we have a Professor, a published author of many papers on OOP, a
well known researcher with years of experience in OOP research, and a
practitioner, somebody who is entirely self taught in computer science
(having studied Economics), and is still a student. There can be only
one possible conclusion:

I retract here an publicly all my previous misleading statements.

In the good tradition of old. For example, just like that florentine
astronomer which had said so properly: 'I hereby renounce and denounce
the fallacious and heretical views that have been previously associated
with me, and here I return and adhere to the truth and the magisterium
of the doctrine, that the Earth is immote in space and the Sun revolves
around it, ...'
--
Piercarlo Grandi                   | JNET: pcg@uk.ac.aber
Dept of CS, University of Wales    | UUCP: ...!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@aber.ac.uk