4 ms·
From http://www.infoq.com/interviews/johnson-armstrong-oop http://www.infoq.com/interviews/johnson-armstrong-oop " Is Erlang object oriented? Joe Armstrong:
by Mutjake 14y ago
From http://www.infoq.com/interviews/johnson-armstrong-oop http://www.infoq.com/interviews/johnson-armstrong-oop
" Is Erlang object oriented?
Joe Armstrong: Smalltalk got a lot of the things right. So if your question is about what I think about object oriented programming, I sort of changed my mind over that. I wrote a an article, a blog thing, years ago - Why object oriented programming is silly. I mainly wanted to provoke people with it. They had a quite interesting response to that and I managed to annoy a lot of people, which was part of the intention actually. I started wondering about what object oriented programming was and I thought Erlang wasn't object oriented, it was a functional programming language.
Then, my thesis supervisor said "But you're wrong, Erlang is extremely object oriented". He said object oriented languages aren't object oriented. I might think, though I'm not quite sure if I believe this or not, but Erlang might be the only object oriented language because the 3 tenets of object oriented programming are that it's based on message passing, that you have isolation between objects and have polymorphism.
Alan Kay himself wrote this famous thing and said "The notion of object oriented programming is completely misunderstood. It's not about objects and classes, it's all about messages". He wrote that and he said that the initial reaction to object oriented programming was to overemphasize the classes and methods and under emphasize the messages and if we talk much more about messages then it would be a lot nicer. The original Smalltalk was always talking about objects and you sent messages to them and they responded by sending messages back.
But you don't really do that and you don't really have isolation which is one of the problems. Dan Ingalls said yesterday (I thought it was very nice) about messaging that once you got messaging, you don't have to care where the message came from. You don't really have to care, the runtime system has to organize the delivery of the message, we don't have to care about how it's processed. It sort of decouples the sender and the receiver in this kind of mutual way. That's why I love messaging.
The 3 things that object oriented programming has it's messaging, which is possibly the most important thing. The next thing is isolation and that's what I talked about earlier, that my program shouldn't crash your program, if the 2 things are isolated, then any mistakes I make in my program will not crash your program. This is certainly not true with Java. You cannot take 2 Java applications, bung them in the JVM and one of them still halts the machine and the other one will halt as well. You can crash somebody else's application, so they are not isolated.
The third thing you want is polymorphism. Polymorphism is especially regarding messaging, that's just there for the programmer's convenience. It's very nice to have for all objects or all processes or whatever you call them, to have a printMe method - "Go print yourself" and then they print themselves. That's because the programmers, if they all got different names, the programmer is never going to remember this, so it's a polymorphism. It just means "OK, all objects have a printMe method. All objects have a what's your size method or introspection method."
Erlang has got all these things. It's got isolation, it's got polymorphism and it's got pure messaging. From that point of view, we might say it's the only object oriented language and perhaps I was a bit premature in saying that object oriented languages are about. You can try it and see it for yourself."
It depends a lot on how one defines OO, but in this regard he has -- or at least he has given some thought for it.
- _glass 14y agoI always asked myself why Alan Kay didn't name it "message oriented" then.
- loup-vaillant 14y agoThe answer to this question is supposed to be in "The Early History of Smalkalk", though I haven't re-read it. Anyway, I just asked on the Fonc mailing list, and got an incredibly detailed answer from Alan Kay himself. To sum it up, someone asked him what he was doing, and he didn't quite have a name for that yet. Heck, he was at the stage of narrowing it down mathematically. So he just answered "object oriented programming", because it fitted with the vocabulary of the time, and went back to work. He did later regretted this label. Now, it's not even sure a better terminology would have helped much. Alan Kay reckons that "it might have helped to have better terminology", but it would probably have been hijacked too: > The success of the ideas made what we were doing popular, and people wanted to be a part of it. This led to using the term "object oriented" as a designer jeans label for pretty much anything (there was even an "object-oriented" COBOL!). This appropriation of labels without content is a typical pop culture "fantasy football" syndrome.
- dragonwriter 14y agoBecause "communicating with messages" is one of the important features of objects, but objects are the focus. The confusion, I think, mostly came about because in the late 1980s early 1990s, an explosion of "Object-oriented" programming happend by gluing classes into existing popular structured programming languages -- producing ObjectPascal and C++ which became the popular "OO" languages which became what "OO" meant to lots of people (Objective-C was a contemporary, and despite being C-based like C++ was more like Kay's idea of OO than C++, but didn't become popular until later.) So what became popularly conflated with "object oriented" programming was statically-typed, class-oriented programming typified by C++ and similar languages (e.g., Java.) There are certainly ways (often not the same ways between languages) in which newer languages -- Erlang, Python/Ruby, etc. -- are more "object oriented" than Java/C++-style languages.