Home » Software Development » Alan Kay Was Wrong About Him Being Wrong

About Yegor Bugayenko

Yegor Bugayenko
Yegor Bugayenko is an Oracle certified Java architect, CEO of Zerocracy, author of Elegant Objects book series about object-oriented programing, lead architect and founder of Cactoos, Takes, Rultor and Jcabi, and a big fan of test automation.

Alan Kay Was Wrong About Him Being Wrong

Time to time someone is asking me what I think about what Alan Kay, the father of OOP, the designer of Smalltalk, the first object-oriented language, said in 1998 about OOP. He literally said that the very term “object” was misleading and a more appropriate one would be “messaging.” Here is what I think.

Rain Man (1988) by Barry Levinson

I believe that there are two orthogonal means of interaction between objects: messaging and composition. Let’s say, we have a point and a canvas:

Point p = new Point(x, y);
Canvas canvas = new Canvas();

This is how messaging would look:


The problem with messaging is that it keeps objects on the same level of abstraction. They communicate as equal and independent “modules,” sending data messages to each other. Even though they look object-oriented, the entire communication pattern is very procedural. We try to encapsulate as much as we can inside a single object, however inevitably still having to expose a lot of its data in order to be able to “connect” it with other objects.

We turn objects into “little computers,” as some books refer to them. They expect data to come it, process the data, and return back some new data. The maintainability problem is not really solved with this approach—we still have to deal with a lot of data, remembering its semantic outside of the objects. In other words, there is no true encapsulation.

On the other hand, this is how composition would look instead:

Point p2 = new PrintedOn(p, canvas);

Every time we need objects to communicate we create a bigger object that encapsulates more primitive ones, letting them interact inside. Of course, the data will also go from object to object, but that will happen inside a bigger object. We can even make the encapsulator and the encapsulatee “friends”, as I suggested before, to make that interaction more transparent and avoid data exposure through getters or even printers.

Let me quote Alan Kay again:

The key in making great and growable systems is much more to design how its modules communicate rather than what their internal properties and behaviors should be.

It seems to me that he means modules, which are not objects. These are different things. Modules are elements of the architecture, while objects are elements of the design. These are two different levels. At the level of architecture we obviously need messages and Kay’s statement is perfectly correct. However, at the level of design we need composable structures, to increase maintainability and messaging is not what can help us achive this goal.

Thus, I believe Alan Kay was right when he invented objects, called them objects, and gave their programming style “object-oriented” title.

Published on Java Code Geeks with permission by Yegor Bugayenko, partner at our JCG program. See the original article here: Alan Kay Was Wrong About Him Being Wrong

Opinions expressed by Java Code Geeks contributors are their own.

(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Leave a Reply


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Notify of