I was speaking to Mr Daniels today and waxing lyrical, as is my wont, about the lovely messaging system in objective C. He commented that something I said was a really nice metaphor so I thought I’d post it here.
Objective C, as you might know, uses square braces (these ) as part of its syntax for sending messages. For example:
Well, it occurred to me that those square brackets make the object and the message look like they’re in a wee box – so when you ask an object for an answer, the question just kinda falls out of the box. Like this:
theAnswer = [myObject whatsYourFavouriteColor];
That’s all it was – but he’s right enough – it helps to make things easy. You drop the question into the box beside the object and the answer falls out the other end 🙂