Hacker News new | ask | show | jobs
by contingencies 3460 days ago
we actually need two different relations: 1) membership relation, and 2) inheritance (or inclusion in more general case).

No. You don't need OO at all, let alone bolt-on conceptual baggage like this.

The notion of object oriented programming is completely misunderstood. It's not about objects and classes, it's all about messages. - Alan Kay[0]

[0] From my fortune clone @ https://github.com/globalcitizen/taoup

2 comments

Message passing only takes you so far. As soon as you want to start reasoning you will structure your messages into groups and now you're back to what looks suspiciously like classes.

I'm not arguing for one or the other but that extreme late-binding as espoused in much of the smalltalk way of doing OO only takes you so far. Static reasoning about program structure is helpful and just message passing alone does not give you enough structure to do that.

> "It's not about objects and classes, it's all about messages"

Often cited, but somewhat meaningless without the context in which Kay originally made that statement.

One should instead consider that object-orientation is "… the insight that everything we can describe can be represented by the recursive composition of a single kind of behavioral building block that hides its combination of state and process inside itself and can be dealt with only through the exchange of messages." - Alan Kay

It is primarily an approach to representing complex problems and systems in code. It is an alternative to modular programming (procedures and subroutines) organized using functional decomposition (structured programming), or an information or data-flow modeling approach. It is not primarily about organizing code.