People continue to argue that modern object-oriented languages, in fact, "not entirely object-oriented," because they do not meet the definition of AOP by Alan Kay. In my opinion, this makes sense, although I do not agree with the conclusion. Recently, I have met people who say that it was Kay who invented objects. In fact, this is not true.
Alan Kay did not invent objects. They were in Simula , which leads as a major source of inspiration a guide to Smalltalk-72 (p. 117). In the 1981 edition of the famous magazine Byte, which popularized Smalltalk and OOP, it says that "the main idea of objects, messages and classes came from SIMULA." It says that Simula allows users to create "object-oriented systems", which is perhaps too, but nonetheless. The Smalltalk team was well aware of the object system in Simula and drew inspiration from it.
One of the reasons why such a myth is still alive was what Kay himself said in 1998 :
I just remind you that at the last OOPSLA I tried to convey to everyone that Smalltalk is not only NOT a syntax or class library, but not even classes. I am very sorry that I previously introduced the term "objects" for this topic, as it forces many people to focus on a smaller idea.
And further in this interview he continues:
I mean, I invented the term "objects." Since we made the objects first, there were no other objects to radicalize it.
Later he stopped saying this , but people still continue to use that quote as a fact.
This is absolutely true.
Recently, many continue to argue that the PLO in fact - not in classes and objects, and that in fact the most important are the messages. In the post of 1998, after Kay said how he regrets about "objects", he also says that "the biggest idea is messaging." He further writes :
OOP for me is only messages, local retention and protection, hiding state and late binding of everything. This can be done in Smalltalk and in LISP. There are probably other systems where this is possible, but I don’t know about them.
In the early PLO, messages were considered important in many respects, primarily for the maintenance of objects. Here’s how Don Ingalls explains OOP in his introduction to Smalltalk-76 :
Smalltalk is more object oriented rather than feature oriented, and this often confuses people with computer science experience. For example, computing<someobject>+4
means sending+4
object as a message. The main difference is that everything is controlled by the object, not+
. If<someobject>
is an integer of 3, then the result will be an integer of 7. However, if<someobject>
was the string'Meta'
, the result could beMeta4
. Thus, the semantic load goes along with the objects of the system, and the code remains an abstract form, simply directing the flow of messages.
In Microelectronics and the Personal Computer, Kay talks about the message-action system, in which "every action belongs to the family," and talks about expanding activity in the "point of view" of object relations as the future boundary. In the guide to Smalltalk-72, he writes (p. 18):
The main idea when writing small talk programs is to define classes that handle the connections between objects in the created environment.
When viewing early sources, a picture emerges that the PLO consists of three main ideas: classes that define the protocol and implementation, objects as instances of classes, and messages as means of communication. The idea that classes and objects were secondary to messages appeared much later.
ACM presented the Turing Award to Dahl and Nyugor, and called them "the PLO co-authors". Also, Byte magazine writes that Simula was object-oriented, and in the article "The Computer Revolution hasn't happened yet," Kay calls Sketchpad "very object-oriented." In my opinion, this does not recognize the merit of Smalltalk in the proper degree. Unlike other systems in Smalltalk:
The last point is the most cunning and perhaps the most important, although no one really explains what makes it so special. In Simula, calling a missing method causes an error. This is part of the Simula specification. In Smalltalk-80, if no method matches the message, the default object returns the message doesNotUnderstand
. The caller can respond to it, either send a message further, or signal an error. The class can also override the default action and do something other than returning the doesNotUnderstand
.
It also means that the messaging system does not depend on the internal structure of objects. They don't even have to be part of one project. It follows that you can do such things as sending messages to objects written in different languages , sending definitions of objects by mail , sending messages via SMS, etc. In my opinion, this is precisely the power of "message passing", but at the same time it is one of the least studied aspects.
People do not invent tools spontaneously. They have specific situations and tasks, and they are trying to find a solution to these problems. Innovations in Smalltalk and OOP are no exception.
Alan Kay was interested in the topic of personal computers. His works on FLEX, Dynabook and Smalltalk are built around this. In his opinion, the PC should have been completely under the control of the user; Everything, from the logic of the core of the system to the graphic rendering, could be customized and explored while working. Messaging and late binding solve a number of problems. If the child installs a new game, do you need to recompile the entire OS to use the new program? No: make it so that you can send an arbitrary message to any object and rely on the processing of the protocol during operation to accomplish the task. (*) If a person violates the logic of the sound system, should the entire OS fall? Of course not, so allow objects to decide for themselves how to process messages. Objects show themselves well here.
Ole Dahl and Kirsten Nyugor tried to solve a completely different problem. They were interested in the simulation . One of the studies in the Simula manual is modeling the spread of infection among a fixed population. The system is completely closed: you have a fixed set of code, you run the simulation and get the result. For them, the transfer of messages is useless. But the ability to define simulations in terms of other simulations, specialize entities, and model time as a first-class object is incredibly useful. Objects also show themselves well here.
So who used objects "correctly"? This is an unreasonable question. They did different things because they had different tasks. Our modern idea of the PLO is a synthesis of all their ideas, as well as the ideas of Adel Goldberg, Barbara Liskov, David Parnassus, Bertrand Meyer, Gul Aga and many others. But none of them can argue what is the "OOP". Concepts develop, as well as tasks.
Interviews taken more than 30 years ago are not good sources.
* Perhaps this makes Powershell the spiritual successor to Smalltalk.
Source: https://habr.com/ru/post/455638/
All Articles