Feeds

A New Year's call to Apple: publish and be damned

Microsoft envy

High performance access to file storage

Mac Secrets Please don't imagine that writing for El Reg is a piece of cake, much less a sizable rum-soaked hunk of Stollen with most of the marzipan in it.

Like war, writing can be hell. The ink was barely dry on my first Mac Secrets column in March 2008, when I got a rather hostile email from a Mac fanboi, telling me that I would go to hell in a hand basket because I was proposing to naughtily reveal all sorts of undocumented secrets relating to the Apple Cocoa APIs.

The gist of his argument was that foolish young developers might read my column, be lead astray by incorporating undocumented API calls into commercial software, and then find themselves up the creek without a canoe when Apple released a new version of OS X.

For sure, there's something to be said for this argument. My correspondent pointed to all the problems that Unsanity experienced in trying to port their stuff from Tiger to Leopard.

Even now, with many people using Snow Leopard, there's been relatively little movement towards Leopard-compatibility, let alone its successor. On Unsanity's website, read Jason's blog entry Hiya Kid's It's Theming Time and then see the following two months of increasingly disappointed whinges from customers demanding an SL-compatible upgrade. Doesn't look good.

So was my anonymous correspondent right? Well, that all depends on whether or not the Unsanity folks used undocumented calls in the implementation of their Application Enhancer (APE) technology. I can't really say, because I've never peeked seriously at the APE code but, if so, this might well explain their present difficulties. That would especially be the case if those undocumented routines don't exist in a 64-bit callable form, because 64-bit operation is the default modus operandi under Snow Leopard.

Now, I have written a couple of plugins for Safari, and I actually found it pretty straightforward to get the code working, both for 32-bit and 64-bit code. Rather than using invasive plug-in managers such as SIMBL, PlugSuit, APE, or the now defunct Input Manager mechanism (no longer supported for 64-bit processes), I simply made use of the DYLD_INSERT_LIBRARIES mechanism to get my bundle loaded by Safari. For another Snow Leopard compatible approach, used by 1Password, click here.

The bottom line is that it's generally possible to find ways to inject plug-in code into specific processes, rather than using techniques that can potentially screw up every running process, either maliciously, or - more likely - through unintentional bugs.

But, getting back to undocumented calls. Another thing my correspondent pointed out was that if an API call was undocumented, it was because Apple weren't ready to document it. This is an argument that I found singularly unconvincing. It suggests, amongst other things, that the undocumented code Apple uses is immature. If true, it would make perfect sense not to document it. But the fact is that Apple routinely use undocumented methods, classes and whole frameworks that have been around for years. If these things were part of the published API, then wouldn't this make everyone more productive?

In the days when I wrote Windows applications for a living with Borland Delphi, it was great having access to the complete VCL frameworks source code. Anytime you came across a weird bug, you could step right through the framework code until the problem became apparent.

This is something that Cocoa developers can't do. In recent times, even Microsoft have seen the light, releasing the source code to their .NET frameworks with the comment that doing so will "enable developers to build better applications and make even better use of them." Presumably, "them" refers to the frameworks in question.

So how about it, Apple? While making your New-Year resolutions, here are a few to chew on:

  • Make the source code of the Cocoa frameworks available. At the very least, this should include AppKit and Foundation. Developers will love you for it.
  • Stop using undocumented API's in application code. Microsoft did it and got hammered for it. You only get away with it because of all the fanbois around. Stop it. Eat your own dog food.
  • Above all, remember that your developers are your friends. Yes, even when they're submitting software for review and inclusion on AppStore. (That one's for Rogue Amoeba).

Have a Happy Holidays and a great New Year. ®

High performance access to file storage

More from The Register

next story
Windows 8.1, which you probably haven't upgraded to yet, ALREADY OBSOLETE
Pre-Update versions of new Windows version will no longer support patches
Android engineer: We DIDN'T copy Apple OR follow Samsung's orders
Veep testifies for Samsung during Apple patent trial
OpenSSL Heartbleed: Bloody nose for open-source bleeding hearts
Bloke behind the cockup says not enough people are helping crucial crypto project
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Windows XP still has 27 per cent market share on its deathbed
Windows 7 making some gains on XP Death Day
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
US taxman blows Win XP deadline, must now spend millions on custom support
Gov't IT likened to 'a Model T with a lot of things on top of it'
prev story

Whitepapers

Mainstay ROI - Does application security pay?
In this whitepaper learn how you and your enterprise might benefit from better software security.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
3 Big data security analytics techniques
Applying these Big Data security analytics techniques can help you make your business safer by detecting attacks early, before significant damage is done.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Mobile application security study
Download this report to see the alarming realities regarding the sheer number of applications vulnerable to attack, as well as the most common and easily addressable vulnerability errors.