Feeds

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

Microsoft envy

Providing a secure and efficient Helpdesk

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. ®

Secure remote control for conventional and virtual desktops

More from The Register

next story
Not appy with your Chromebook? Well now it can run Android apps
Google offers beta of tricky OS-inside-OS tech
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
Greater dev access to iOS 8 will put us AT RISK from HACKERS
Knocking holes in Apple's walled garden could backfire, says securo-chap
NHS grows a NoSQL backbone and rips out its Oracle Spine
Open source? In the government? Ha ha! What, wait ...?
Google extends app refund window to two hours
You now have 120 minutes to finish that game instead of 15
Intel: Hey, enterprises, drop everything and DO HADOOP
Big Data analytics projected to run on more servers than any other app
prev story

Whitepapers

Secure remote control for conventional and virtual desktops
Balancing user privacy and privileged access, in accordance with compliance frameworks and legislation. Evaluating any potential remote control choice.
Saudi Petroleum chooses Tegile storage solution
A storage solution that addresses company growth and performance for business-critical applications of caseware archive and search along with other key operational systems.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.