| > 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. |
| |
| ▲ | MaxBarraclough an hour ago | parent | next [-] | | > 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. | | |
| ▲ | 9rx 7 minutes ago | parent [-] | | 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. What did most programmers settle on for this in order to free up OO for other uses? |
| |
| ▲ | flohofwoe 4 hours ago | parent | prev [-] | | > 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) :) | | |
| ▲ | kccqzy 3 hours ago | parent | next [-] | | 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. | |
| ▲ | 9rx 4 hours ago | parent | prev [-] | | 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? |
|
|