9 ms·
> The conceptual purist perspective: > > The notion of object oriented programming is completely misunderstood. It's not about objects and classes, it's all ab
by Ace17 9y ago
> The conceptual purist perspective:
>
> The notion of object oriented programming is completely misunderstood. It's not about objects and classes, it's all about messages. - Alan Kay
>
Given that Alan Kay is the one who came up with the term "object oriented", it might be wise to give him authority about the definition.
- raverbashing 9y ago"Misunderstood" is a nice cop-out. Sure, misunderstanding happen, true. But at a certain point it becomes just another excuse. And that's not to get into the "SOLID" definitions which are more a feel-good word for handwave and murky definitions typical of the "True Scotsman" fallacy
- coldtea 9y agoDefinitions arise in real world use, independently of who might have first invented a concept or coined the term. In the end, only how a term is used by the majority of people matters -- because only that retains the basic requirement of language: to say something and have it be understood.
- psyc 9y agoThat would be next to impossible, since the term is overwhelmingly used by working programmers in the context of C++/Java/C#/etc. Also, I suspect that the only reason Kay's version is even brought up in every discussion of the term is some sort of programmer-hipster signaling thing. Not that Kay's OO isn't important - it is. It's just hardly ever relevant to the actual discussion.
- PaulStatezny 9y agoI really dislike this kind of hand-wavy dismissal of ideas/opinions as “programmer-hipster”. It seems to assume the person in question has no intelligent reason behind their thoughts/opinions. And it dismisses the opinion instead of engaging with it intellectually. And having been on the receiving end, it’s insulting. It feels like being called stupid. It’s fine to disagree with opinions, but when you assume people are “signaling”, you’re assuming the worst about people before seeking to understand them.
- psyc 9y agoI get what you're saying, but I'm still persuaded this is what happens with Kay and/or smalltalk. 100 times I've seen threads about OO. 99 times someone brought up Kay/smalltalk. Zero times did they specify why the messaging model was relevant to the present discussion. That's important to do, because more OO programmers use C++/C#/Java, and are not smalltalk experts. So, it seemed to me that they were namedropping. Which opinion should I have engaged with?
- PaulStatezny 9y agoThat makes sense. Sounds like the kind of comments you tend to see are out of context and don’t engage with the subject matter. I can see how that comes across as signaling.
- bitwize 9y agoDuck typing is central to the Smalltalk "vision thing". That and the idea that a message is a symbolic representation of a method, which an object may or may not support. It is not, in fact, the method, nor does it stand for a direct call to the method. In C++ and Java, for a call to a.foo(12) the compiler can look up the class of a, determine whether it has a foo implementation, and if so compile a call directly with the number 12. In Smalltalk, a foo: 12 has no such implications. Rather the runtime will look up whether a's class has a foo: method at call time and if so, invoke that method; otherwise invoke the object's doesNotUnderstand: method with the message and arguments as parameters. There's an added layer of indirection there. It's rather like a single-threaded Actor model. Kay was trying to get people to think in terms of encapsulated objects that communicate in (often ad hoc!) ways, not in terms of inheritance trees or type hierarchies. Is it better? Is it worse? I don't know. We know Smalltalk is slower, but it (along with Objective-C) admits designs unfathomable in C++. For example, all objects that understand a given protocol (set of methods) and implement it in a sensible way are substitutable with each other (with respect to the protocol) irrespective of their place on the inheritance hierarchy (or even whether such protocol was formally defined). This is NOT true with C++, absent template metaprogramming, and it's not true with Java unless you define an interface and assert that all classes which understand those methods implement that interface. Furthermore, by overriding doesNotUnderstand:, you can specify a behavior for classes when sent a message they don't have a method for, besides raising an error. Maybe you want them to forward the method to one or more delegate objects, or log the invocation. It's super-flexible, powerful, and neat in a similar dynamic-language way to how Lisp is neat. That's why Smalltalk attracts so many fervent converts. As I said, it can be better or worse depending on your perspective. Some people like working with type hierarchies; Haskell, Rust, and even C++ attract fervent converts too!
- Ace17 9y ago> Not that Kay's OO isn't important - it is. It's just hardly ever relevant to the actual discussion. Having a debate over inheritance without a consensual definition of OO is gonna lead us nowhere. The word "OO" has been a selling buzzword for several decades. Which means our best bet in getting a sensible definition is to pick the original one. This is why we keep bringing up "Kay's OO" (which also is, by the way, Coplien's OO, Reenskaugh's, Dave West's ...)
- sreitshamer 9y agoI think this means doing composition/delegation, which the author of TFA calls "basically giving up on implementation inheritance."