Newsgroups: comp.object,comp.lang.smalltalk,comp.lang.ada
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!howland.reston.ans.net!nntp.crl.com!pacbell.com!tandem!nntp-hub2.barrnet.net!newshost.ea.com!psinntp!psinntp!psinntp!psinntp!merlin.hgc.edu!jcm
From: jcm@hgc.edu (James McKim)
Subject: Re: Has C++ had its day?
Message-ID: <1995Jun28.140600.6412@merlin.hgc.edu>
Sender: usenet@merlin.hgc.edu (Action News Central)
Organization: The Hartford Graduate Center
References: <Jan.Bytesmiths-2606951420580001@hgc.edu> <NEWTNews.804269222.4596.sellers@sellers.sellers.com>
Date: Wed, 28 Jun 1995 14:06:00 GMT
Lines: 75
Xref: glinda.oz.cs.cmu.edu comp.object:33857 comp.lang.smalltalk:25156 comp.lang.ada:31856

In article <NEWTNews.804269222.4596.sellers@sellers.sellers.com> John Sellers <sellers@sellers.com> writes:
>
>In Article<1995Jun27.121935.4921@merlin.hgc.edu>, <jcm@hgc.edu> 
>write:
>> ...
>> 
>> I'm genuinely curious about why Smalltalkers (or at least a 
>number who
>> have posted here) find inheritance to be important and useful, 
>but do
>> not feel the same way about multiple inheritance. ...
>
>There are some good OO experts who feel that multiple inheritance 
>is a good thing under the right circumstances.  Bertrand Meyer 
>comes to mind.  He points out the necessity of being very 
>diciplined in its use.
>
>However, multiple inheritance can easily become a real rat's 
>nest.  It is an open invitation to making things over complex.

Well, I agree it can easily be misused, but so can nearly every 
feature in any language. And I agree it adds complexity to
the language, although most of this is due to the special case
of repeated inheritance. The question is whether its
benefits offset the additional complexity. There's a tradeoff
involved. Smalltalk has chosen simplicity in this case.


[...]

>
>Sticking with single inheritance makes it easier to structure 
>class so that each class has one main purpose in life.

Perhaps. If true, wouldn't disallowing inheritance make it even easier?
Surely single inheritance can be misused as well. This is another tradeoff. 
Smalltalk has chosen complexity in this case.

You see the more important question in my original post had to do
with how Smalltalkers typically use inheritance. A number of recent
Smalltalk posters have indicated that they don't use it to model
is-a-kind-of (i.e. subtyping) relationships. So I'm wondering just
what you _do_ use it for. Once I have some feeling for that, I can
perhaps better understand why it makes sense to include single,
but not multiple inheritance.

>
>One company I worked for recently has an interesting perspective 
>that emanates directly from their president.  "Simplify, 
>simplify, simplify, and get the architecture right."  He has been 
>able to pull a couple of big rabbits out of the hat with that 
>philosophy.  I think the same philosophy is an excellent one for 
>Smalltalk.  A corollary of this would be, "Never use multiple 
>inheritance when single inheritance will do".  In my experience, 

Well, how about, "Never use inheritance where composition will do."

>I haven't found a single case on the job that single inheritance 
>couldn't handle well.

What relationship, say between class A and class B, is it that single 
inheritance handles well? And is there never a case where A might
have this relationship to another class, C, as well?

Best,
-- Jim

>


-- 

*------------------------------------------------------------------------------*
Jim McKim  (203)-548-2458     Co-editor of Eiffel Outlook 
Internet:  jcm@hgc.edu        Subscribe early and often!
