Feeds

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

Microsoft envy

Top 5 reasons to deploy VMware with Tegile

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
Euro Parliament VOTES to BREAK UP GOOGLE. Er, OK then
It CANNA do it, captain.They DON'T have the POWER!
Download alert: Nearly ALL top 100 Android, iOS paid apps hacked
Attack of the Clones? Yeah, but much, much scarier – report
NSA SOURCE CODE LEAK: Information slurp tools to appear online
Now you can run your own intelligence agency
Post-Microsoft, post-PC programming: The portable REVOLUTION
Code jockeys: count up and grab your fabulous tablets
Twitter App Graph exposes smartphone spyware feature
You don't want everyone to compile app lists from your fondleware? BAD LUCK
Microsoft: Your Linux Docker containers are now OURS to command
New tool lets admins wrangle Linux apps from Windows
prev story

Whitepapers

Designing and building an open ITOA architecture
Learn about a new IT data taxonomy defined by the four data sources of IT visibility: wire, machine, agent, and synthetic data sets.
Getting started with customer-focused identity management
Learn why identity is a fundamental requirement to digital growth, and how without it there is no way to identify and engage customers in a meaningful way.
10 threats to successful enterprise endpoint backup
10 threats to a successful backup including issues with BYOD, slow backups and ineffective security.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
10 ways wire data helps conquer IT complexity
IT teams can automatically detect problems across the IT environment, spot data theft, select unique pieces of transaction payloads to send to a data source, and more.