| ▲ | flohofwoe 5 hours ago | |
> 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 4 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 5 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? | ||