Structure and Interpretation of Computer Programmers

I make it easier and faster for you to write high-quality software.

Tuesday, June 10, 2008

WWDC – day one

The WWDC keynote is always an odd event to attend. It’s put on for the benefit of the investors and the media, with the developers being invited purely to act as braying masses expressing their adulation for His Steveness. It’s rare for any technical content to make it into the session, except in unavoidable cases such as the 2005 keynote. The focus of that was the Intel transition, so by necessity there had to be some technical justification of the switch.

With this in mind, it’s not hard to see that the keynote can be a somewhat dull affair. Obviously as both an Apple customer and member of the “economic ecosystem” of the Mac, it’s always good to be as informed as possible of the company’s position and direction. That said, yesterday’s keynote (no wi-fi in this hotel, so a late post) contained less of interest to me than usual.

As I mentioned I’m financially dependent on Apple (in an indirect sense of course; I’m paid to write Mac software for Sophos, therefore no Mac = no job at Sophos), though as I’m not an indie dev I have a bit more of a comfort buffer than many people. The enterprise iPhone video Steve showed was basically a backslap in front of the shareholders; look, there are people who really do use this stuff! Then the laundry list of every developer who’s downloaded the SDK and managed to get something to compile; interesting to see the wealth of different domains into which the iPhone is entering, but seriously. Two demos, three tops. Not all four thousand of the known apps. Good to see TEH CHEAP being applied to the 3G iPhone, though; I may have to
have a discussion with Orange about a PAC when that’s available.

Which left Mobile Me. This is actually a pretty cool reboot of iTools^W.Mac, OK it looks like there might be no more iCards but on the other hand the Mobile Me syncing is really beneficial. I can see that becoming more of a cash cow for Apple, though mainly because they opened it up to the PC; people who have an iPod and Windoze could buy MM to synchronise their contacts, mail and so on, as well as getting webmail access (and webmail access which doesn’t suck balls as much as
Exchange’s OWA, may I add). That then might make them more amenable to the Halo Effect and the purchase of a Mac down the line.

The rest of the day was interesting but obviously undisclosable, except for the evening I spent in a couple of bars down the financial district (the Golden%Braeburn event at 111 Minna, where I went with Steffi from BNR and a couple of Cocotron committers; then Dave’s bar where I met Nigel and most of Apple UK). Conversation ranged from Sophos feature requests to the drinkability of American IPAs; all good stuff!

posted by Graham Lee at 14:49  

Monday, June 9, 2008

WWDC part 0

well, here it is, the pre-WWDC “I’m jetlagged so you have to put up with my wittering” post. I’m just waiting for a softwareupdate to finish so that I can go out with my camera, taking some early-morning pictures before heading off to stand in line for the Stevenote. I was out for beers with Ian and Neil last night, we’d all heard rumours of a 5 a.m. start to the queue. On the two previous occasions that I’ve been, 9 a.m. has been sufficient; but with the sellout nature of the event it’s likely that the room will fill up rather quickly so we’ve compromised on a 7 a.m. start. Actually, forget the 5 a.m. nonsense, there’s a line of overnight campers – I can’t decide whether they’re deliberately trying to re-enact a Joy of Tech cartoon, or actually have nothing to do with their lives.

posted by Graham Lee at 12:42  

Friday, June 6, 2008

This means business

This is the design of the business card I’ll be taking to WWDC. Let’s look at some notable features.

  • Photo in top left. I don’t know about you, but I find it much easier to remember what someone looks like than who they are – this card is available so that people can combine the two.
  • Plenty of blank space. The back is also entirely empty and can be written on. When people exchange business cards there’ll usually be some context, it can help you remember what that is if you write it down. For instance, I’ve got cards from previous WWDCs with handwritten notes like “webobjects employer”, “bindings”, “parallels openstep” and “huge hat” (bonus points for identifying all four).
  • Questionable source code snippit. This is a deliberate ploy to annoy fellow-developers with our compulsive attention to detail, thus helping to cement the meeting in their mind as well as providing an inoffensive conversation starter.
  • Minimal contextual detail. I’m pretty sure I won’t get through all 250 cards in one sitting, so they ought to remain relevant for as long as possible.
posted by Graham Lee at 19:01  

Wednesday, June 4, 2008

Little hack to help with testing

Want the ability to switch in different test drivers, mock objects, or other test-specific behaviour? Here’s a pattern I came up with (about a year ago) to do that in a GNUstep test tool, which can readily be used in Cocoa:

NSString *driverClassName = [[NSUserDefaults standardUserDefaults] stringForKey: @"Class"];
Class driverClass = NSClassFromString(driverClassName);
id myDriver = [[driverClass alloc] init];

With a healthy dose of no, seriously, don’t do this in production code, you now have the ability to specify your test driver on the command-line like this:

$ ./myTestingTool -Class GLTestDriver

This uses the oft-neglected behaviour of NSUserDefaults, in which it parses the executable’s command-line arguments to create a defaults domain, higher in priority than even the user’s preferences file. You can use that behaviour in a graphical app too, where it comes in handy when working in Xcode. It then uses a combination of the runtime’s duck typing and introspection capabilities to create an instance of the appropriate class.

posted by Graham Lee at 19:18  
« Previous Page

Powered by WordPress