Little Boxes

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 🙂

Related posts

Creating a Bramble

So, my current Raspberry Pi cluster isn't really a true cluster - it's really...

OUTAAAAGE!

So, nelefa.org fell off the internet last night, for the first time since 1997....

A conversation with JD

j.daniels: 15 minute job to move disks and filesystems? That's impressive. What's your...

Latest posts

Horse Whisperer (1998)

M'okay, overbearing workaholic mum takes extremely traumatised daughter and her equally traumatised horse to...

Make that two years

The Web is dead, consumed by adverts that chase you around the page, cat...

Oh my.

So, it looks like I'm averaging a post a year at the moment. That's...

State of the cluster

Here we see, in all its glory, the little mini-cluster of Computery Goodness which...

Creating a Bramble

So, my current Raspberry Pi cluster isn't really a true cluster - it's really...

3 comments

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.