Path: utzoo!mnetor!uunet!husc6!mailrus!ames!claris!apple!dan From: dan@Apple.COM (Dan Allen) Newsgroups: comp.lang.c++ Subject: Critique of Wiener/Pinson Message-ID: <8063@apple.Apple.Com> Date: 12 Apr 88 18:15:19 GMT Reply-To: dan@apple.UUCP (Dan Allen) Organization: Apple Computer Inc, Cupertino, CA Lines: 83 Keywords: Object-oriented,abstract data types,C++,definitions A brief critique of: "An Introduction to Object-Oriented Programming and C++" (Richard S. Wiener & Lewis J. Pinson. Addison-Wesley. ISBN 0-201-15413-7.) follows. Wiener & Pinson is definitely a needed book, as Stroustrup's book is somewhat hard to read, a fact admitted by many on the network. However, Wiener & Pinson (W&P) has a few flaws itself... My main concerns are with some of the definitions of object-oriented programming. At the last main conference on object-oriented programming, OOPSLA '87, Peter Wegner's paper entitled "Dimensions of Object-Based Language Design" gave the following definition of what it means for a language to be object-oriented: object oriented = objects + classes + inheritance Further definitions of these terms define objects to be instances of a class, and classes to be an organizational tool that allows inherited qualities to be passed to subclasses, etc. Now for the problems. Wegner goes on to define data-abstraction as an ORTHOGONAL attribute to object-orientedness, for the following reason(s): data abstraction and the notion of abstract data types provide for the description of a data structure and some associated function and procedures that have sole access to the data structure. Wegner's point is that object-oriented languages allow access to the underlying data structures BY DIRECT REFERENCE rather than only through the (to use OO language) associated methods of the class. OO languages can also use functions and procedures to access the data structure as well. Well, W&P do not make this distinction. Pages 1,2, and 57-58 particulary are full of definitions that are not in keeping with the main body of OO language designers. Now, what is C++ then? Well, C++ is interesting in that its classes are, by default, supportive of abstract data types and the data abstraction paradigm by making fields of a class private. (Remember, private data = Data Abstraction.) C++ also supports object-oriented programming by allowing fields to be declared public. (Public data = Object-Oriented if inheritance is also supported, which it is in C++). Now there is a definitional problem at hand: what if some fields are public and some fields are private? C++ has created a new definitional problem. I must point out that W&P is fairly consistent internally with the definitions that are used. My gripe is that they are using the same terms as the mainline Object-Oriented world, but with new and changed definitions. A few more guidelines with the definitions that I subscribe to: ** Ada is NOT object-oriented. Ada does support data abstraction. ** Object Pascal IS object-oriented, but does NOT support data ab. ** Modula-2 is NOT object-oriented. It does support ADTs. ** C++ supports both object-oriented programming & ADTs, though not at the same time. (Stroustrup's definitions are more in line, by the way, with mine and Wegner's than with W&P.) Sorry for the long flame about definitional problems, but I have been working with object-oriented languages for several years here at Apple and have found them a little hard to teach to people because of problems such as these. When Stroustrup came to Apple recently, he spoke about such matters and he seems to have a good understanding of these issues. His talk also was much more understandable than his book, so if you ever get the chance to hear him, make sure to take advantage of it. You'll enjoy it. I did. Dan Allen Software Explorer Apple Computer