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:

[myObject init];

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 :)

3 Responses to “Little Boxes”

  1. Redsmartie says:

    Paul Daniels?

    That’s magic… not a lot of people know that.. whoops, Debbie, where’s me hair piece?

  2. John says:

    No, you silly man! >John< Daniels. The scary terrorist-looking person!

  3. Redsmartie says:

    I know not of this man ye speak of but i do know a Jack Daniels

Leave a Reply

All content (C) 1996-2008 John Dow