Live data from Hacker News

Alan Kay on the Meaning of “Object-Oriented Programming” (2003)

purl.org

21–30 of 58 posts

Re: Alan Kay on the Meaning of “Object-Oriented Programming” (2003)

#21
post #12

A lot of the recent trend towards OOP-bashing comes from bad implementations of OOP, just as bashing design patterns is more to do with badly thought out architectures and overuse of those patterns. In fact, the origins of OOP are basically what we would now call microservice architecture (CSP-inspired languages like Go being a specialisation of this). Each service can be as stateless or as stateful as it needs to be…

In sports, training coaches sometimes forbid to use some play element. In OOP classes there should be an assignment to design a system without inheritance. Just to show what is most important in OOP.

I was taught OOP using Modula-2 in 1989, by defining structures and functions that took a pointer to the struct as first parameter. No inheritance goodies! I used that style in C until 1996 when I definitely moved to C++. Probably why I am not terribly dismissive of OOP but very much of things like inheritance trees, the Java OOP style, and the overuse of GoF in architecture, literature and especially programming discussions.

Re: Alan Kay on the Meaning of “Object-Oriented Programming” (2003)

#22

"OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things." Bam. That is it right there. Java really messed this up. Strong static typing and OO is an abomination.

So what specifically about OO gets so much better as soon as you take types away? Can you give a specific improvement?

Ability to change or replace object instances (maybe with instances of different types) on the fly could be an example. In general, you can design incredibly dynamic and reconfigurable systems. Whether you want to or not, and at what level should you stop doing it, is certainly a good debate to have.

Re: Alan Kay on the Meaning of “Object-Oriented Programming” (2003)

#23
post #9

A lot of the recent trend towards OOP-bashing comes from bad implementations of OOP, just as bashing design patterns is more to do with badly thought out architectures and overuse of those patterns. In fact, the origins of OOP are basically what we would now call microservice architecture (CSP-inspired languages like Go being a specialisation of this). Each service can be as stateless or as stateful as it needs to be…

It seems to me that you can't really do message passing in most languages with high efficiency? (Objective-C and Swift being the exceptions.)

Rather the opposite. Almost all HPC (high-performance computing) systems use message passing and not shared memory. The fastest and imho best unix-like kernel L4 is entirely MP based.

So if you want to embrace high performance (and concurrent), go message passing. Alan Kay's favor of late binding does not help performance, as method lookup at run-time dominates the cost then, but the fast systems are early bound, i.e. typed.

Re: Alan Kay on the Meaning of “Object-Oriented Programming” (2003)

#24
post #16
post #9

Earlier quoted context omitted.

It seems to me that you can't really do message passing in most languages with high efficiency? (Objective-C and Swift being the exceptions.)

I think it's a bit charitable to call what Objective C does to be "message passing". The messages are not asynchronous and have only a single recipient, so in practice I would say they're method calls with late binding.

You can do one-to-many messages via notifications, though it's less elegant.

Re: Alan Kay on the Meaning of “Object-Oriented Programming” (2003)

#25
post #3

Towards the end: But just to show how stubbornly an idea can hang on, all through the seventies and eighties, there were many people who tried to get by with "Remote Procedure Call" instead of thinking about objects and messages. Sic transit gloria mundi. Can somebody explain to me what distinction he's drawing here? What's the issue with RPC that's solved by Objects+Messages?

A remote procedure call is analogous to an ordinary function call, extended to a remote machine. It is static, perhaps even specifying the code to be executed, and therefore limited. But objects can be understood as independent agents (Kay calls them "real computers"), where a message is a request for some behavior. How the object is to implement that behavior is not specified in the message.

Kay gives the example of the Internet itself. A GET request for a URI used to be understood as an RPC: download the file at this path. But today GET requests are routinely abstracted. There is no literal directory /r/programming on reddit. Instead path components are better understood as parameters, i.e. arguments in a message send! And this lets them do anything they want, be implemented in any manner at all.

Unfortunately, this is one directional. Your browser makes an abstract request, but the server replies with literal code (e.g. JavaScript) that it wants executed on its behalf. The browser is sending messages to the server, but the server is making RPC calls to your browser.

This gives some insight into the relative stagnation of the client-side, compared to the explosion of server-side. Kay wrote that, if you communicate via messages, then "each object could be implemented using the programming language most appropriate for its intrinsic nature." We have that on the server, but are a million miles away from that with clients.

Re: Alan Kay on the Meaning of “Object-Oriented Programming” (2003)

#26
post #20

Earlier quoted context omitted.

For example an automobile can be thought of as an emitter of pollution, if your problem concerns pollution, or, it can be thought of as a particle, if your problem concerns traffic congestion. The auto "fits" into each of these different problem domains.

Thanks for the reply, but I'm still not seeing the connection to algebra?

He means "algebra" in the "universal algebra" sense of the word: http://en.wikipedia.org/wiki/Universal_algebra

That probay doesn't clarify the connection, but at least you'll be pointed in the right direction! :)

Re: Alan Kay on the Meaning of “Object-Oriented Programming” (2003)

#27
post #20

Earlier quoted context omitted.

For example an automobile can be thought of as an emitter of pollution, if your problem concerns pollution, or, it can be thought of as a particle, if your problem concerns traffic congestion. The auto "fits" into each of these different problem domains.

Thanks for the reply, but I'm still not seeing the connection to algebra?

[deleted]

Re: Alan Kay on the Meaning of “Object-Oriented Programming” (2003)

#28
post #20

Earlier quoted context omitted.

For example an automobile can be thought of as an emitter of pollution, if your problem concerns pollution, or, it can be thought of as a particle, if your problem concerns traffic congestion. The auto "fits" into each of these different problem domains.

Thanks for the reply, but I'm still not seeing the connection to algebra?

[deleted]

Re: Alan Kay on the Meaning of “Object-Oriented Programming” (2003)

#29
post #23
post #9

Earlier quoted context omitted.

It seems to me that you can't really do message passing in most languages with high efficiency? (Objective-C and Swift being the exceptions.)

Rather the opposite. Almost all HPC (high-performance computing) systems use message passing and not shared memory. The fastest and imho best unix-like kernel L4 is entirely MP based. So if you want to embrace high performance (and concurrent), go message passing. Alan Kay's favor of late binding does not help performance, as method lookup at run-time dominates the cost then, but the fast systems are early bound, i.e…

Well, you are discounting CUDA, which has been seen as suited for many tasks when compared to MPI. Of course, you can use MPI and CUDA together (people are working on that), which you then have messaging between nodes and shared memory (via GPU-style SIMD) within.

Of course, you are probably referring to NUMA, but people still actually use that.

Pure OO isn't very much desired in the HPC world, but then neither is pure FP.

Post reply on HN