upvote
In the end though most of those 'sending a message' actions are just fancy virtual method calls (e.g. an indirect jump), everything else would be much too slow:

https://www.mikeash.com/pyblog/friday-qa-2017-06-30-dissecti...

IMHO the whole 'message' and 'sending' lingo should be abandondend, the job of objc_msgSend is to look up a function pointer by certain rules. There are no 'messages' involved, and nothing is 'sent'.

reply
> There are no 'messages' involved, and nothing is 'sent'.

The conceptual difference is significant as an object can respond to messages that it doesn't have a method for. You are, conceptually, just sending a message and leave it up to the object what it wants to do with it (e.g. forwardInvocation:). That is, after all, what sets "object-oriented" apart from having objects alone. Optimizations that can be made under the hood don't really affect the language itself.

reply
> can respond to messages that it doesn't have a method for.

Clang produces a warning in that case though (something along the lines of "object might not respond to ..."), I don't think that feature is particularly useful in practice (also because it kills any sort of type safety) :)

reply
And the reason it’s a warning and not an error (like in C++) is that it’s actually possible that the object can respond to such a message but the compiler doesn’t know about it.
reply
It was incredibly useful in the olden days. The NeXT/Apple ecosystem leaned on it heavily.

We have new ways to approach problems nowadays, so it may be fair to say that object-oriented programming is a relic of the past. I mean, it is telling that Smalltalk, Objective-C, and Ruby are the only languages to ever go down that road. Still, if you are using an OO language, then it makes sense to lean into OO features. Otherwise, why not use a language better suited to your problem?

reply
> That is, after all, what sets "object-oriented" apart from having objects alone.

I wouldn't say so, most object-oriented languages don't work like Objective-C/Smalltalk. Today, I think most programmers would agree that inheritance is the defining feature of object-orientation.

reply
Okay, that's what sets what was classically known as "object-oriented" apart.

Understandably, language evolves. If OO means something different today, what do most programmers call what used to be known as OO? I honestly have never heard anyone use anything else. But I am always up for refreshing my lexicon. What did most programmers settle on for this in order to free up OO for other uses?

reply
Then what does it mean if "composition over inheritance" is also taught as a good practice in OO?
reply
That's a rule-of-thumb to help beginners in making judgement calls. It doesn't mean inheritance should never be used.
reply
True, but if the defining feature of something is a feature you should use sparingly, doesn't that mean other features are more definitive?
reply
> a 'true' OOP language, like Smalltalk.

I guess Simula, which is older than Smalltalk, doesn't get a say.

reply
What would it have to say about it? When "object-oriented" was first told, it was said that what defines it is message passing. Simula does not have message passing. It uses function calling. Simula does have objects, but having objects does not imply orientation.
reply