Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!pt.cs.cmu.edu!sei!ajpo!eberard From: eberard@ajpo.sei.cmu.edu (Edward Berard) Newsgroups: comp.object Subject: Re: Evaluating "Object-Oriented" Programming Languages Summary: Answers and References Keywords: object-oriented, programming languages, evaluation, bibliography Message-ID: <644@ajpo.sei.cmu.edu> Date: 7 Jan 90 03:31:53 GMT References: <638@ajpo.sei.cmu.edu> <706@cui.unige.ch> Lines: 218 In article <706@cui.unige.ch>, anders@cui.unige.ch (BJORNERSTEDT Anders) writes: > In article <638@ajpo.sei.cmu.edu> eberard@ajpo.sei.cmu.edu (Edward Berard) writes: > > > HISTORICAL BACKGROUND > > > >In the very early 1970s, things were simple. There was only one > >programming language which called itself "object-oriented," i.e., > >Smalltalk ([Goldberg and Robson, 1983]). Further, all that anyone > > Was Smalltalk really available in the "very early 1970s" ? > Speaking from personal experience from the early 80s, I was working with > Simula. OO-terminology was certainly used at that time, but as I remember > it Smalltalk was not readily available. The first version of Smalltalk was Smalltalk-72 (e.g., [Goldberg and Kay, 1976]), which was "available" in 1972. There were also versions released in 1974 and 1976 (e.g., [Ingalls, 1978]). The most important, and most widely distributed version became available in 1980, i.e., Smalltalk-80. The August 1981 issue of Byte was a special issue on Smalltalk, and contained at least 5 articles on Smalltalk and object-oriented programming. To be sure, the introduction of Simula, preceded the first introduction of Smalltalk by at least 6 years. (See, e.g., [Dahl and Nygaard, 1966].) Further, Alan Kay acknowledged his debt to Simula both in the attempted creation of FLEX, and in the development of Smalltalk. (See [Kay, 1977].) However, Smalltalk is significantly different from Simula. Specifically, it contains features which are "lacking" in Simula, and many consider these "missing" features essential to an object-oriented language. [Note: It is interesting to watch some people discuss the origins of object-oriented programming languages. On one hand, they wish to cite the introduction of Simula as the beginning of object-oriented programming. This provides the "credibility" of being around for about 24 years. On the other hand, some of these same people will say that "Smalltalk was the first 'true' object-oriented programming language." However, this gives them only about 18 years of longevity, i.e., going from Smalltalk-72.] REFERENCES [Dahl and Nygaard, 1966]. O.J. Dahl and K. Nygaard, "SIMULA -- an ALGOL-Based Simulation Language," Communications of the ACM, Vol. 9, No. 9, September 1966, pp. 671 - 678. [Goldberg and Kay, 1976]. A. Goldberg and A. Kay, Editors, Smalltalk-72 Instructional Manual, Technical Report SSL-76-6, Xerox PARC, Palo Alto, California, March 1976. [Ingalls, 1978]. D.H.H. Ingalls, "The Smalltalk-76 Programming System Design and Implementation," Fifth Annual ACM Symposium on the Principles of Programming Languages, January 1978, pp. 9 - 15. [Kay, 1972]. A. Kay, "A Personal Computer For Children of All Ages," Proceedings of the ACM National Computer Conference, Boston, Massachusetts, August 1972. [Kay, 1977]. A.C. Kay, "Microelectronics and the Personal Computer," Scientific American, Vol. 237, No. 3, September 1977, pp. 230 - 244. [Krasner, 1983]. G. Krasner, Smalltalk-80: Bits of History, Words of Advice, Addison-Wesley, Reading, Massachusetts, 1983. [Schoch, 1979]. J. Schoch, "An Overview of the Language Smalltalk-72," SIGPLAN Notices, Vol. 14, No. 9, September 1979, pp. 64 - 73. > > >A major source of problems in any comparison scheme is the confusion > >between concepts and implementations. For example, in Smalltalk, > >objects communicate (i.e., work gets done) via "message passing." > > There is also a confusion between terminology and concepts. The > Smalltalk notion of "message passing" (synchronous and blocking) is > closer to the normal function call (especially if you have virtual > functions like in Simula) than it is to "message passing" in the sense > of the actor model of Hewitt. I will grant anyone that "message passing" has a multitude of meanings. What is important is that the objects which populate a system have some means of communicating with each other (and the outside world). To engage in a discussion of what constitutes "true message passing," or the "best message passing" is to accept an invitation into a black hole. > > > - Types: Whereas a class defines the structure and > > characteristics of its instances, a type defines those > > operations in which an object may participate, and under > > what circumstances the object may legally participate in > > those operations. Types are a relatively new concept in > > object-oriented programming. Smalltalk has, in effect, no > > I would argue that types are an old concept in object-oriented programming... Here you have me, sir. By not being more precise than I was, I have left myself wide open. I could argue your point by citing a classic definition of types, i.e.: "A type defines a set of values, and a set of operations applicable to those values." In this sense, all programming languages, even "older" object-oriented programming languages, have types. However, this is not the point. In Smalltalk, the concept of "class" extends to the lowest levels, and the term "type" cannot even be found in the index of [Goldberg and Robson, 1983]. When object-oriented thinking began moving to languages other than Smalltalk, there was a collision between "classes" and "types." Questions began to arise, e.g.: - Are classes and types the same thing? - Are classes a form of types, or are types a form of classes? - If classes and types are different, _how_ are they different? Some of this discussion has led to some interesting results. (In another message, I will reproduce some discussions on typing in Smalltalk.) In fact, the definition of types that I furnished in the original article is but one of many interpretations of types in an object-oriented programming language. Depending on which definition you favor at the moment, I am either accurate, or "way off base." > > > - Static Versus Dynamic Binding: Binding is the association of > > allowable operands (i.e., objects) with operations. Binding > > This sounds like the binding of actual to formal parameters. What you > mean is: Static versus dynamic binding of method. which is the binding > of method to a given invocation including operands. This leads to some interesting discussions. For example, if you are in a situation where you have "ad hoc polymorphism," i.e., the method selected for a particular operation will depend on the class/type of the operand(s), then you can view the situation as you have described it. If, however, you have "general polymorphism," i.e., the same method will be used for the operation regardless of the class/type of the operand(s), then some other explanation may be necessary. [There is also the concept of "inside views" vs. "outside views." Specifically, do you describe binding from the viewpoint of those outside the object, i.e., where they cannot tell if different methods are being selected, or do you describe binding from the viewpoint of inside the object, i.e., where you can tell exactly how a given operation is being accomplished?] > > > Static binding is usually associated with strongly typed > > programming languages, and dynamic binding with weakly-typed > > programming languages. Smalltalk and Objective-C support > > dynamic binding. > > You are correct here because you qualify with the first sentence with > "usually". Strong typing and "dynamic binding of method" are theoretically > orthogonal. You will find many people who will disagree with you on this point. For example, I also received another opinion on this same section of my original article: "It seems to imply that strongly-typed languages are never associated with dynamic binding: but C++, Trellis, Eiffel, and Modula-3 are clearly strongly-typed and support dynamic binding. (One place where binding may have been discussed is in the functional programming community, where a function variable is "dynamically bound" in contrast to a static function reference. Even C supports dynamic binding through function pointers.)" > > True, but the "normal" way of doing oo-programming in Simula is by invoking > functions/procedures on instances of classes, which corresponds closely > if not exactly to how it is done in Smalltalk. But I agree that the term > "message passing" has degenerated as much as the term OO itself. See my earlier comment about discussing message passing. > > > Smalltalk and Loops equate message-passing with > > remote procedure calls, a synchronous form of > > message-passing in which the sender must wait for a reply > > form the receiver before continuing. > > I would just say "procedure call" and not "remote procedure call" > when speaking of Smalltalk and Loops which in their standard form > do not support distribution. Lets not add the term RPC to the list of > terms which have lost meaning. All I intended to say (by quoting Peter Wegner) was that message passing has a number of different interpretations and implementations. > > > - types (strong typing). Many people have complained > > about Ada's strong typing. This makes the trend > > towards more strongly typed object-oriented > > programming languages that much more ironic. > > Uh-Oh, you (Edward Berard) seem to be biased against strong typing. > Whether or not strong typing is desirable depends on 1) personal taste > and 2) the problem to be solved and its context. I would argue that > strong typing (which does not exclude polymorphism) is more important > in large and critical applications. [Note: If you could see my mail (;-)). If I did not know any better, I would think it was a plot. Some of you guys must have gotten together beforehand and agreed to send contradicting messages (;-) ;-)). I got another message accusing me of being biased _in_ _favor_ _of_ strong typing. Ah, ... but such is life. 8^}] You get half credit (;-)). I am biased. (Horrors! :-)) However, I am biased in your direction. I tend to agree strongly with you that strong typing is more important in large and critical applications. -- Ed Berard (301) 353-9652