Live data from Hacker News

Alan Kay on the misunderstanding of OOP (1998)

lists.squeakfoundation.org

41–50 of 212 posts

Re: Alan Kay on the misunderstanding of OOP (1998)

#41
I find it interesting that everyone gets so up-beat about the ideology or philosophical debate about objects sending each object messages, hell even not relying to a message one object send you until a later date. Without even thinking about concurrency, state, and hell even the basics such as cyclic loops within a event based system!

Though I keep hearing from Alan and other prominent language designers that we still are holding onto this old 1960 mental model of command and control, or structured design concepts. Even some well spoken people suggest that the whole notion of object's are worthless to programmers because it takes place within the notion of classes and constraints of the machine.

This whole philosophical debate about understanding/miss-understanding/correct usage of OOP is just a complete waste of time.

For what its worth I consider object's simply as a basic level category of procedures and data tied to a namespace. If the category requires state then consider it as a object otherwise its considered a module.

I've seen too many project's that have drunken the cool aid and has resulted in 5-10 level deep inheritance tree's with their own branching logic trying to fit behavior to a specific taxonomy.

Re: Alan Kay on the misunderstanding of OOP (1998)

#42
post #3

Are there any examples of Kay's ideal other than The Internet? Especially systems that I could actually inspect and learn about in detail, rather than read short stories about.

Hearing the way Alan Kay talks about "messaging" always reminds me of two technologies: the Flux/Redux architecture and Apache Samza & Kafka. > 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. With React and Flux, this is exactly what's going on! You're defining view components, and when someone interact…

Redux is definitely a step in that direction. Elm, which it's inspired by, is even further along that road in that its design is better handled (but then it doesn't require handling in JavaScript so I suppose that is why)

Re: Alan Kay on the misunderstanding of OOP (1998)

#43
post #38
post #14

IMO the problem with object-oriented programming is that it turned into the standard curriculum for peoples' first semester of computer science, rather than being yet another interesting concept that advanced programmers would ponder. And the way we handle "the standard CS curriculum" sucks. (In the USA at least.) For example, AP Computer Science requires Java and tries to teach stuff like designing inheritance hiera…

> It's totally inappropriate - most of these students would fail fizzbuzz. Maybe this is related to the common occurrence of people who can provide stellar answers to interview questions about inheritance hierarchies and object composition... and yet can't pass a basic fizzbuzz style test?

It may actually be directly caused by it. If you want people to come to your university, you need good post-degree employment figures.

If every tech interviewer phone-screens by asking about multiple inheritance and red-black trees, it's really not surprising that universities might tip the curriculum towards that sort of thing at the expense of actual programming experience. After all, if you can't pass the phone screen you'll never get the opportunity to write code.

Re: Alan Kay on the misunderstanding of OOP (1998)

#44
post #11
post #3

Are there any examples of Kay's ideal other than The Internet? Especially systems that I could actually inspect and learn about in detail, rather than read short stories about.

Biological cells: I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages (so messaging came at the very beginning -- it took a while to see how to do messaging in a programming language efficiently enough to be useful). (from http://www.purl.org/stefan_ram/pub/doc_kay_oop_en )

I wonder: what is that last sentence referring to? What got it right first? (Or gets it right now?)

Re: Alan Kay on the misunderstanding of OOP (1998)

#45
post #17
post #12

Earlier quoted context omitted.

Alan commented on this several times in the AMA he did here a couple days ago: https://news.ycombinator.com/item?id=11957001 https://news.ycombinator.com/item?id=11945986 https://news.ycombinator.com/item?id=11945123

I have to admit I still have basically no idea what he's talking about when he says 'messaging'. A practical example would be useful for us non-CS-degree programmers who don't speak any of the CS lingo.

For me there's a disconnect in the handling. So in a traditional approach, you write one function that takes in input and spits out an output (called, say, FUNCTION_A).

Then you have another function (FUNCTION_B) that maybe does some stuff and then calls FUNCTION_A with an internal variable and bam you're done.

In messaging, FUNCTION_B doesn't call FUNCTION_A. It just shouts out (or sends a message containing) something like "I need to turn my internal variable into a given output". Somewhere in the application will be a process that listens out for just that message and then does something in response to it.

So you have all these modules (or cells in some examples) that are shouting out things and then you have other cells (or a single brain) that take in all the messages that are being shouted and do stuff based on the content of the message. You could think of a stock market trading floor (with a whole bunch of people scrambling and shouting stuff, although obviously much more orderly in a program) or the cells in your body that send messages to your brain (like cells in your fingers sending "the human is putting his hand on a hot stove, tell him to take it off before us little cells die" and then your brain - and you - react).

Re: Alan Kay on the misunderstanding of OOP (1998)

#46

Earlier quoted context omitted.

One example is the HTTP GET request. This was originally conceived of as a file download, where the URL path is mapped directly to filesystem paths. GET as an RPC: "download the file at this location." But in modern thinking, HTTP GET is a request with abstract semantics. The URL's path is abstract, and may be interpreted arbitrarily by the server. The client has no idea whether the request is serviced by a simple se…

Can you define "reifiable" for me? I come across it a fair bit in clojure, but I still don't really understand what the term means.

Reifying means to take the abstract and make it concrete. Reflection is an example: take a language feature, like a class, and make it into real data. Many languages have some reflection capabilities for types; message sending takes this even further.

For example, in Java, I can take a class and make data out of it: dynamically look up fields, etc. I can also do that with a method. But I cannot take a method call and turn it into data. I can sort of do it with a lambda, but lambdas make poor data:

1. A lambda is concrete, not abstract. It's literally "run this code." 2. Even if your lambda merely invokes a method on an object, it's still opaque. I can't pick it apart, get the parameters or method name out, etc.

Here's some practical objects you can't make in Java:

1. Envelope: wraps an arbitrary remote object Contents. Any method you invoke on Envelope gets sent over the wire and invoked on Contents.

2. Delegator: represents the union of one or more objects, the Delegates. Any method invoked on Delegator gets re-sent to the first Delegate that understands it.

3. Tee: Any method you invoke on the Tee gets multicast to its wrapped objects.

4. Mapper: wraps a list. Any message you send to Mapper sends it the elements of its list, and returns the resulting list.

etc. Put directly, Java method invocations are procedure calls, not messaging. But once you reify method invocations into object, it opens up all sorts of dynamic possibilities.

Re: Alan Kay on the misunderstanding of OOP (1998)

#47
His distinction reminded me of what I wrote in a comment regarding Dissipative Adaptation and its relationship with language [1].

If Alan Kay is right, and Wittgenstein is right, and Prof. England is right, then we should be focusing on the language that emerges from the necessary transactions between functions, and let those transactions define the objects. That would make the modern popular understanding of OOP completely backwards -- as backwards as our understanding of the role of language prior to Wittgenstein and the role of thermodynamics in biology prior to England.

Meaning, objects should not define (infer or induce or implement) the communication, nor the expression. Rather, all transactions (interactions, communications) should define (infer or induce or implement) the objects. And, given names, the objects will find a way to sort themselves based on rate of utility (the chosen objects, just as we choose the right words, from which refined definitions sort themselves).

(Sorry for all the parentheses.)

--

[1] https://news.ycombinator.com/item?id=11341397

Before Wittgenstein philosophers were obsessed with the factual nature of words and tried mapping everything correctly (logically) with the natural world. Except, they were failing.

Wittgenstein came in and basically said language was never designed to represent reality, but rather is what emerges from the use cases between people. Communication is a transaction ("game" in his words), and not some mathematical or logical construct. It may have such properties, and the people and the context are all real, so reality is involved, but language is not a direct output, nor does it need to directly correlate to resist contradiction or paradox -- which are abound in philosophy.

Except, for those who speak it, language is their reality. Those who cannot overcome their own immersion can never see past their own words, which sums up much of his opposition. They are all correct in their world and in their words... except Wittgenstein was talking about how words and worlds worked.

In short, words can be arbitrary, and are constrained by the goal to communicate and transact. This exact phenomenon which Wittgenstein described as what we are doing is the phenomena England is describing as what biological systems are doing.

It's all Dissipative Adaptation, with language being the unique construct for every such system that emerges and sustains it all.

Re: Alan Kay on the misunderstanding of OOP (1998)

#48
post #40

I find it interesting that everyone gets so up-beat about the ideology or philosophical debate about objects sending each object messages, hell even not relying to a message one object send you until a later date. Without even thinking about concurrency, state, and hell even the basics such as cyclic loops within a event based system! Though I keep hearing from Alan and other prominent language designers that we stil…

"For what its worth I consider object's simply as a basic level category of procedures and data tied to a namespace.“

I mean you're just using different words to talk about the same thing. In your terminology inheritance is just extending a namespace and overloading names.

How does that discredit or put into question the "mental model of command and control, or structured design concepts"

If anything I feel the failure of OO languages is that they have been afraid of baking in proven design patterns/principles that reoccur over and over (ie. Gang of Four and a few more since then). Yesterday i was staring at some undocumented OpenCV code trying to figure out why there was some pointer that kept showing up in random places. After a very confusing 30 minutes i figured out it was actually the pImpl idiom. Now why do we have to have to reimplement the pImpl idiom each time? why can't this be a keyword?. The amount of code bloat and confusion that a visitor introduces is the prime reason I never use them. (There was an interesting proposal at CppCon 2 years ago that addressed this, but as far as I know it's not gone anywhere)

The problem is that the most OO language trace back to C which IS a half-assed language from the perspective of "concurrency, state, and hell even the basics such as cyclic loops within a event based system" and most languages that do OO have been half baked on top of that foundation.

Re: Alan Kay on the misunderstanding of OOP (1998)

#49
post #8

How is messaging different than calling a method?

A "method" is just a programming construct. A message in OOP is sent to an object to tell it to do something itself.

In an OO approach, rather than have a Hammer hit a Nail, the Hammer sends a message to a Nail which knows how to be hit.

Post reply on HN