Monday October 17, 2011

Namespacing Hack in Objective-C

Dost my eyes deceive me? Mike Ash over at his blog has an interesting post about name spacing constants and functions in Objective-C. Actually it’s raw C, but quite useful within in Objective-C, too.

I’ve ranted at length about the lack of good name spacing in Objective-C. Using character prefixes gives us such ungodly names as NSManagedObjectContextDidSaveNotification. Well, weep a bit less with this tip.

I’m hesitant to use this full throttle because it’s definitely not normal in the Apple world. Code must be written so that the humans who follow you up can edit it, you know. But, still, when Apple is done reinventing memory management on portible devices, I hope they have some cycles reserved to solve namespacing in their flagship programming language.