Newsgroups: comp.lang.lisp,comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!news-peer.gsl.net!news.gsl.net!news.sprintlink.net!news-peer.sprintlink.net!howland.erols.net!netcom.com!vrotney
From: vrotney@netcom.com (William Paul Vrotney)
Subject: Re: OOP, Flavors and CLOS: or What's the big deal?
In-Reply-To: william@brain's message of 16 Dec 1996 19:11:58 GMT
Message-ID: <vrotneyE2K62E.BnK@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <5946tu$2pmq@news.doit.wisc.edu>
Date: Tue, 17 Dec 1996 12:44:38 GMT
Lines: 92
Sender: vrotney@netcom21.netcom.com
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp:24276 comp.lang.scheme:17736

In article <5946tu$2pmq@news.doit.wisc.edu> william@brain (William Annis) writes:
> 
> 	[WARNING: the author of this little post will take great
> exception with anyone who construes the following text as an invitation
> to a language war.]
> 
> 	I've seen Flavors' use in Genera (the Symbolics "OS") held up
> as a great example of Object Oriented Design.  Are there any similarly
> complex systems being used that have been written in CLOS (apart from
> CLOS itself that is)?
> 
> 	I have Symbolics manuals from both the message passing days and
> the generic methods/functions days.  I think the OOPy interface to the
> window system was nice-ish. 
> 
> 	Another question I have is motivated by comments by Henry Baker
> (ftp://ftp.netcom.com/pub/hb/hbaker/CritLisp.html) and by some ideas from
> Gabriel (http://www.ai.mit.edu/articles/good-news/subsection3.3.6.html).
> They both insist, without justification, that OOP support is a sensible
> and basic thing to add to a language.  I'm not quite sure I buy this.
> For example, I largely view C++ as a way to protect yourself from armies
> of indifferent programmers.  I've used classes as a convenient way to
> bundle things up, but is this really more than sugar?  
> 
> 	I guess my larger question is "Is OOP anything more than
> syntactic sugar to make good programmer's jobs a bit easier?"  C++
> doesn't make a bad C programmer a good programmer (any more than Lisp
> will, either).  And OOPing up a language introduces all sorts of problems
> for the language implementer (especially with respect to method dispatch
> for generic methods and inheritance trees).  When I first heard about
> "Object Oriented Programming" everyone was all ga-ga over it, but
> when I got to it I didn't quite see what all the excitement was about.
> Then I thought it was ok.  Now I find I don't quite see the point again.
> I guess I just think there's got to be some better way.
> 

I don't know if there is a better way, but you are not alone in thinking
that OOP is much ado about almost nothing.  For myself, the only real
significant application of OOP was in the NeXTSTEP operating system.  If
this is in fact one of the greatest achievements of OOP then the fact that
NeXT died and NeXTSTEP is not doing that great says that the whole world
either does not appreciate the concept or can't afford it.  NeXTSTEP uses
Objective-C.

The Symbolics Flavors of windows was OK but one had to learn a whole bunch
of stuff just to do some simple thing.  The old INTERLISP window system was
just a few pages of function calls.  Is was very quick and easy to
understand and use.  And you could do whatever you needed with it.  It
certainly makes you wonder why it was necessary to introduce something like
Flavors.

Lets look at the properties of OOP, they are

    1. Inheritance
    2. Encapsulation
    3. Polymorphism

As I recall there are actually 5 properties, but I can't remember what the
other two are this late at night, perhaps someone can add the other two.

One definition of OOP languages is that procedure and data is replaced by
messages and objects.  But objects traditionally, especially in Lisp, was
just another form of data and message passing in practically all OOP
languages reduces to a function call.  So even this definition of OOP is
wanting.

As it turns out these properties are easy to simulate or even do pretty well
in Lisp without OOP.  (2.) is easy to do without OOP; just the ordinary Lisp
struct has this property.  (3.) is a given in Lisp lambda expressions.  (1.)
can be simulated in many programming languages and in Common Lisp almost
duplicated without OOP.  In Common Lisp you can "include" one struct in
another and get the effect of inheritance.

In C++, considered to be one of, if not the most popular OOP languages.  As
for (2.) in C++ the same applies to C++ structs as Lisp structs.  (3.) C++
doesn't do very well.  Virtual functions are weak and C++ can not even
effectively do dynamic binding in all its glory.  And even (1.) C++ does not
do very well.  I've been told to avoid multiple inheritance in C++ since
there can occur problems with the layout of data.

The Meta Object Protocol, one of the greatest insights in OOP seems to be
largely ignored by most of the programming world.  Smalltalk, hailed as the
most OO of OOP languages is considered by many as going overboard with the
idea.  And Java, it's hard to tell where Java is headed these days.

One could look at OOP from another less gloomy perspective, like predict the
future of software ICs, or optimize implementations using MOP strategies.
But until some of this future magic happens in a big way one has to wonder.

-- 

William P. Vrotney - vrotney@netcom.com
