2 ms·
> Am i missing anything ? > sender.message(receiver, params) It's the receiver that determines what messages they can understand, and the sender itself rarely
by jolmg 5y ago
> Am i missing anything ?
> sender.message(receiver, params)
It's the receiver that determines what messages they can understand, and the sender itself rarely has anything to do with the message apart from sending it. It doesn't make sense to make the sender an important part of the syntax for message-sending. By keeping the sender out of the syntax, the syntax of a particular call is the same no matter how the sender changes from moving the code around.
Also, writing it as receiver.message(params) follows English grammar of subject-verb-object ordering, allowing the code to read more naturally.
> sender.send(receiver, message, params)
If you're asking about the use of the word "send", at least Ruby uses it, but it's receiver.send(message, params). That particular call does not follow English grammar, but you only ever use the "send" message when the message is variable. It's not common.