🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #4973

Re: C++ vs Objective-C

#4973
From: Ken Hawley
Date: Thu, 19 Nov 1987 21:24
41 lines
2551 bytes
>In article <1662@ppi.UUCP> cox@ppi.UUCP (Brad Cox) writes:
>>For example,
>>consider the different kinds of problems in building an automobile.
>> . . .

To which Mr. Adams of Multimate International says, in part:

> . . .       Objective-C
>forces you to give up type checking entirely for cases where you want any
>dynamic binding.

This comment is relevant only if you choose to build you system in a way
that makes dynamic binding important, i.e. using extensive sub-classing.

If you are building an end user system, you can sub-class to your heart's
content.  However, if you are building a GENERIC PRODUCT, then there are
serious shortcomings to the extensive use of sub-classing.

The alternative is to use a small number of generic objects together with
(what Cox has called) property lists to configure or "parameterize" those
objects for a particular application.  Voila!  Dynamic binding without the
binding!  You don't get type checking either, but you have gained something
much more valuable:  a generic application.

To go back to Cox's example:  consider the automobile assembly.  You could
have a wheel object, a vehicle object, an engine object, a trunk object, etc.
Or you could have one, "assembly" object which takes on the properties of a
wheel, a vehicle, an engine, or a trunk depending upon how it's configured.
In the first case, if you change the engine, you must change the class.  In
the second case, you merely change the property list.

Remember why we use object techniques:  (1)data hiding, (2)reusability,
(3)explicit modelling of physical systems, (4)distributability, (5)scalability.

Inheritance is a MEANS, actually only one means, to achieve these objectives
in an object environment.  It is not an END in itself.

-- 
Kenneth J. Hawley   (hawley@mas1)      Measurex Automation Systems
{...}pyramid!voder!mas1!hawley         Cupertino, CA / Detroit, MI
{...}codas!mas1!hawley                 (408)973-1800  (313)271-0333
Technical Details
Message-ID: <980@mas1.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!pyramid!voder!mas1!hawley

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!pyramid!voder!mas1!hawley
From: hawley@mas1.UUCP (Ken Hawley)
Newsgroups: comp.lang.misc,comp.lang.smalltalk,comp.lang.c++
Subject: Re: C++ vs Objective-C
Message-ID: <980@mas1.UUCP>
Date: Thu, 19-Nov-87 16:24:46 EST
Article-I.D.: mas1.980
Posted: Thu Nov 19 16:24:46 1987
Date-Received: Sun, 22-Nov-87 03:03:48 EST
Distribution: na
Organization: Measurex Automation Systems, Cupertino, CA
Lines: 40
Keywords: Dynamic Binding or Not