Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2(pesnta.1.2) 9/5/84; site scc.UUCP Path: utzoo!utcs!lsuc!pesnta!scc!ted From: ted@scc.UUCP (Ted Goldstein) Newsgroups: net.lang,net.lang.st80 Subject: Re: Re: Definition of Buzzwords: "Object-Oriented" Message-ID: <431@scc.UUCP> Date: Mon, 18-Feb-85 20:40:46 EST Article-I.D.: scc.431 Posted: Mon Feb 18 20:40:46 1985 Date-Received: Tue, 19-Feb-85 02:13:57 EST References: <4288@ucbvax.ARPA> <163@wanginst.UUCP> <5424@duke.UUCP> Distribution: net Organization: Santa Cruz Computer, Inc, Aptos, Calif. Lines: 84 Xref: utcs net.lang:1401 net.lang.st80:198 > Fundamentally, Smalltalk doesn't do anything differently from Ada; it > just hides it differently. > > Trying to give a talk on Object-Oriented Programming, I searched high > and low (through all the Smalltalk books, for example) for a definition > of OOP -- and found none. Either we have to take it as an undefined > term, or we ought to find a definition. I'm unsatisfied with the > definition that has been offered by several people ("It's what Smalltalk > does that no-one else does") because a) I can't find that (tell me the > fundamental difference between passing messages and passing parameters > by name) and b) it makes "Object-Oriented Programming" == "SmallTalk > Programming" which seems to eliminate any chance of using the term or > the idea usefully in anything BUT SmallTalk. > > Personally, I think the term should be discarded as being too fuzzy for > scientific use. First, let's find out just what an Object is! > > -- > Opinions stated here are my own and are unrelated. > > Charlie Martin > (...mcnc!duke!crm) > > "I am not a number, I'm a free variable!" A friend of mine defines an `object' as "Data with an Opinion." That is, using the type of the object, a function/operation is selected which is appropriate to that type. This is nothing new to computer languages. Addition is different for integer and floating point numbers. Yet syntactically a programmer coding in many high level langauges write a + b and leave the work to the compiler to determine whether to use integer add or floating add primitives. Smalltalk-80, and other object-oriented languages promote this concept so that it is uniformally applied to all operations and types, whether they are system defined or user defined. But to come up with a less fuzzy opinion: More formally, an "Object" is a type defintion with a closure on what operations may be performed on it. Objects are similar to ADA's packages when used in conjunction with ADA generic calls. Almost all Smalltalk-80 objects are defined in a hierarchical fashion. ADA Packages can be hierarchically composed too, but the generic operations cannot be used after the first level of the hierarchy. The hierarchical nature is natural in Smalltalk-80 because binding between the generic call and the actual function (method) is dynamic. That is, it occurs at run time. I think Smalltalk-80 is superior to ADA in this respect, because more code is re-usable because operations (when apropriate) tend to be defined at higher levels of the hierarchy. ADA generic operations are selected by the type of all of its arguments, while Smalltalk operations are selected by the first argument only. C++ is similar to ADA in this way; multiple argument type binding on generic operations are a property of compile time bindings. C++ combines some of Smalltalk-80 and ADA's power. Like ADA, C++ has generic operations. These are frequently resolved at compile time, and thus incur no addtional penalty. Some generic operations in a hierarchically defined types cannot be known at compile time. Smalltalk and C++ both have dynamic binding available when the inheritance cannot be determined (This is known as virtual functions in C++). ADA must know all package defintions and make resolve all generic functions at compile time. I hope we see more of C++ in the world. -- Sincerely, Ted Goldstein, Freelance Consultant "Don't thank me, thank Uni" from 'This Perfect Day' by Ira Levin ihnp4!pesnta -\ fortune!idsvax -> scc!ted ucbvax!twg -/ Santa Cruz, California (408) 662-3112