Live data from Hacker News

Alan Kay on the misunderstanding of OOP (1998)

lists.squeakfoundation.org

171–180 of 212 posts

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

#171
post #115

Earlier quoted context omitted.

Functions have no internal state. Early languages used global variables to share state across functions without explicit message passing (everything was a singleton). This created worlds of pain. The alternative was passing state with each function call. This also got painful as people often passed data down through functions. OOP lets chunks of functions share state and hide that state from the wider application. Mo…

> Functions have no internal state. But closures do. And thus, why closures are a poor man's objects, and objects are a poor man's closures. As an example, Java closures are really anonymous objects with the closed state as instance variables. > More importantly you could have multiple instances of that shard state without explicit management, saving a lot of complexity and effort. Technically that's what classes giv…

> Technically that's what classes gives you, not objects. But agreed on the sentiment.

No, that's what objects give you. Classes are merely one means of creating objects (others exist), but the benefits come from the objects, not their means of construction.

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

#172

Earlier quoted context omitted.

> Functions have no internal state. But closures do. And thus, why closures are a poor man's objects, and objects are a poor man's closures. As an example, Java closures are really anonymous objects with the closed state as instance variables. > More importantly you could have multiple instances of that shard state without explicit management, saving a lot of complexity and effort. Technically that's what classes giv…

If you apply this common understanding of "closure" where the values that closures close over are not really values but mutable objects , then closures don't count as (pure) functions. If one thinks of them as proxies to the closed-over objects, they are quite like "procedures". Another way to think about them is simply as objects with only a single method.

They are definitely still "functions", barring the fact that Java doesn't have first-class functions and SAMs are the closest thing. C# does have first-class functions, and it is even more liberal in its closure rules. (Java can only close over `final` variables, which are immutable variable bindings. C# doesn't even have immutable variable bindings, only member bindings.)

Also, they can still be "pure functions". Purity is a relation of side effects, not of mechanisms. (Even then, it's a somewhat loose definition -- is allocating memory a side effect?) If you don't allow closures to escape their declared scope, you can handle closed values as extra parameters. So closures don't mean you suddenly can't write pure functions, it means that some input to the function is pre-determined. In other words, closures have the same implications to purity as parameter binding -- absolutely none.

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

#173
post #60

Earlier quoted context omitted.

Well, try to remember that for Alan, inheritance is at most an optional feature of OOP, so maybe those "5-10 level deep inheritance trees" aren't as much about people drinking the OOP "cool-aid" as you think.

Both simual and smalltalk inheritance was added later in the languages history. Yes its optional but it doesnt stop people making a mess of things when they categorise their objects based on data type instead of behaviour

Nothing can stop bad programmers from writing bad code. Take OOP away from them, and they'll just write bad procedural code or bad functional code; their bad code is not a stain on the paradigm they choose to abuse.

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

#174

Earlier quoted context omitted.

> Functions have no internal state. But closures do. And thus, why closures are a poor man's objects, and objects are a poor man's closures. As an example, Java closures are really anonymous objects with the closed state as instance variables. > More importantly you could have multiple instances of that shard state without explicit management, saving a lot of complexity and effort. Technically that's what classes giv…

> Technically that's what classes gives you, not objects. But agreed on the sentiment. No, that's what objects give you. Classes are merely one means of creating objects (others exist), but the benefits come from the objects, not their means of construction.

My point is that you can have an OOP language / system that consists entirely of singletons. The ability to create multiple object instances from a template is classes or prototypes or whatever other mechanism. It's not something strictly necessary to OOP.

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

#175
post #105

Earlier quoted context omitted.

Or a cow's opinion! No but seriously, I think both you and hackits make it clear that there's a lot of discussion over what OOP actually is. Which makes me curious: is there any research on the characteristics of OOP as it implemented in practice across languages? I'd be very interested in such research, because it seems to me that what is possible is often not practiced. So, for example, Ruby might be all about 'mes…

As of a research paper by Kaijanaho, Antti-Juhani ( https://jyx.jyu.fi/dspace/handle/123456789/47698 ) Since 1960 till 2012, there are only 22 research papers that used empirical evidence with randomised cross over studies for language design. As of which, Class inheritance had 4 randomized controlled experiments. With a collection of other studies. That is mostly of the information I have come across. There is a res…

I'm not sure measuring how programmers use programming languages would help you gauge whether those languages are any good. It's like measuring the way people rode bicycles in 1880 - that would never lead you to invent the car.

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

#176

Earlier quoted context omitted.

Seriously? Have you watched any of the demos Alan references? They were doing things with computers in the 1960s/70s that still haven't reached mainstream use as yet. Computers as used today are still absolutely dumb machines that are little more than super-fast calculators, and in most cases increases the mental burden of their users instead of reducing/augmenting them. Nicholas Negroponte had a great quote in '94 t…

Can you summarize what those things might be? (That haven't reached mainstream use)

Here are 2 that he often brings up:

Ivan Sutherland's Sketchpad demo - Object oriented graphics using a constraint based system (https://www.youtube.com/watch?v=6orsmFndx_o)

Douglas Englebart's demo - too many innovations to list, but includes real time collaboration (he demoed in a convention center while the system ran 30 miles away in his lab, connected by a leased line operating at 1200 baud!). People think he just invented the mouse, but the overarching theme in his work was augmenting human capabilities... http://dougengelbart.org/firsts/dougs-1968-demo.html

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

#177
post #150
post #66

Earlier quoted context omitted.

I can think of a good list of OO languages that don't have anything to do with C. Also the pImpl is a consequence of C++ not adopting modules and instead rely on C linkers, nothing to do with OOP.

Yup. We were looking at alternate runtimes in some OS / userland projects at Apple in the late 80s. You don't need vtables, and you can do better than static struct layout. You have to do some work at code load-time. C++'s initial lack of a real string type and simple collection types pretty much doomed the language. (Instead they did iostreams? I've been using C++ since early CFront days, and have never used that mi…

I guess I am one of the few people on the planet than enjoys using iostreams when I need to use C++. :)

Then again, I never needed to know all their little details.

Yeah implementing string, array and collection types was a kind of rite of passage for every C++ developer, back when the compilers were still trying to catch up with C++ARM.

I believe appealing to the C culture was one of the reasons those types weren't initially available, as C++ was already considered too bloated by the C community even without them.

Nowadays their three major compilers are written in C++.

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

#178
post #149

I'd love clarification on a few points, from anyone who understands everything Alan says here: Think of the internet -- to live, it (a) has to allow many different kinds of ideas and realizations that are beyond any single standard Is he referring here to alternative protocols from http, or to the fact that behind the single http protocol are servers written in myriad languages and styles? If you focus on just messag…

Regarding the internet (and the design of TCP/IP in particular), here's a comment by Alan from his recent AMA: https://news.ycombinator.com/item?id=11960130 One interesting point from a talk of his - the internet has never broken or been unavailable since they turned it on, even though it has gone through about 3 successive generations of hardware/software.

So the idea, essentially, is that TCP/IP is like a "free form field" where people can write whatever they want, and then everyone is free to create their own structure on top of that, to suit their needs. In contrast to some protocol that accepted only, say, XML? His point, then, is that not forcing such structure was a crucial ingredient in the internet's success?

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

#179

Earlier quoted context omitted.

We probably won't, at least not at human-scale and not on Earth. Flapping wings don't scale; there's a reason you have to get to #12 of the heaviest birds list to get one that flies, at ~13% the maximum mass of the heaviest bird. https://en.wikipedia.org/wiki/List_of_largest_birds#Table_of...

I wonder where pterodactyls would fall on that scale.

Looks like Wikipedia has us covered:

https://en.wikipedia.org/wiki/Pterosaur_size#Speculation_abo...

From the references, this is a pretty good read:

http://www.scientificamerican.com/article/how-pterosaurs-fir...

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

#180
post #142

Earlier quoted context omitted.

Note this email and conclusion are from 2003-07-23: > OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them.

The original article gives some important context to this sentence, as otherwise it is slightly weird, as both ST-80 (at least in comparison to earlier Smalltalks) and CLOS does not have that much explicit concept of messaging and in both cases it's essentially late bound function call.

What? Smalltalk80 has #doesNotUnderstand: which allows explicit handling of messages directly so no, it's not a late bound function call.
Post reply on HN