Newsgroups: comp.lang.c++,comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.sprintlink.net!in2.uu.net!nntp.cadence.com!news
From: Simon Kinahan <simonk>
Subject: Re: C++ vs Smalltalk?
Content-Type: text/plain; charset=us-ascii
Message-ID: <DGwBA1.Cw5@Cadence.COM>
Sender: news@Cadence.COM
Content-Transfer-Encoding: 7bit
Organization: Cadence NVision
References: <27GVjB$04E@zoe.pcix.com> <45rijq$3lp@tandem.CAM.ORG> <45tbeg$b04@mujibur.inmind.com> <463vml$us0@caesar.ultra.net>
Mime-Version: 1.0
Date: Mon, 23 Oct 1995 09:49:12 GMT
X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.3 sun4c)
X-Url: news:463vml$us0@caesar.ultra.net
Lines: 33
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:155904 comp.lang.smalltalk:29749

><>Inheritance per se is indeed only an implementation device, a means
><>to reuse already written code.

This is a very Smalltalky thing to say. As the langauge is totally untyped,
inheritance can't play its other role of providing a type structure (not
that Smalltalk loses as much as it might by this, because of the 
fast edit/compile/debug cycle). Other languages (Sather, C++, Quest)
have inheritance playing a dual role, sometimes clearly distinguishing
the two kinds and sometimes not. 

><Absolutely wrong!  Inheritance is primarily to provide abstractions
><and define the structure of the system.  The more formal that is
><done the better.  Code reuse is nice when it happens, but is really
><irrelevant to OO programming.  There are lots of ways to reuse
><code.  Organization of the design is far more important than saving
><the occassional line of code.  This is what I mean about Smalltalk
><encouraging implementation inheritance rather than abstraction
><inheritance.

This is a very C++ point of view. Code reuse in C++ is very hard to
achieve, so, as you say, most people don't bother. Inheritance is
very good for defining abstractions, but it is also very good for 
saving code. This is not clear in C++, but it is clear in Smalltalk.
Smalltalk programmers are trained from the beginning that it is
OK to have inheritance crossing structural boundaries (houses inheriting
from elephants etc) if it saves code. You are right about smalltalk.
Abstraction
inheritance is really meaningless in an untyped language.

Simon.
-- 
     1

