inessential by Brent Simmons


This article—Going Native: The Attraction of the Cocoa Interface—is exactly the kind of thing that drives me crazy.

Me, I’m a Cocoa developer, so you’d think I’d appreciate an article that compares Cocoa to Carbon and declares Cocoa the winner.

But there’s just too much misinformation here. It’s the kind of thing I’ve read other places, too. There is a class of user who’s biased against Carbon—unreasonably, in my opinion. A good app is a good app.

I’ll take a few points from the article:

1. “Carbon is still very much a work in progress, and that Apple has been somewhat slow to provide access through the Carbon environment to all the ‘goodies’ that come with the Mac OS X architecture.”

Cocoa is still very much a work in progress too, and there are plenty of goodies, visual and otherwise, that aren’t accessible via Cocoa. (Compare the palettes in Interface Builder to see what’s missing in Cocoa, or try writing an OSA component.)

2. ” is a bit difficult, especially for a non-developer such as myself, to keep track of what exactly is Cocoa-specific and what can be used by both Cocoa and Carbon applications.”

Good! Why would you want to? A good app is a good app.

3. “Once a feature is made accessible through the Carbon environment, the developers of these Carbon applications still need to update them to make use of this feature. And that process can and will take months and even years in some cases.”

This is true in some cases, not true in other others. Same thing with Cocoa, of course.

4. “But, with Jaguar, Apple has made the brushed-metal visual appearance a core component of the system’s interface, which, in Cocoa applications, can actually been turned on or off by simply toggling a single ‘switch’ somewhere in the definition of the interface.”

Same is true for Carbon. It’s a checkbox in Interface Builder. Exactly the same as with Cocoa.

5. “...drawers are, as far as I can tell, an interface tool that is only used in Cocoa applications.”

Carbon developers, beginning with Jaguar, can also create drawers.

6. “...another interface feature that is pretty much specific of Cocoa applications is the dialog sheet.”

Carbon apps can use sheets too. That many don’t yet is not the fault of Carbon.

7. “While OS X’s customizable toolbars are not the exclusive domain of Cocoa applications...”

True. Carbon apps can use the new HIToolbar, which is the equivalent of the Cocoa toolbar.

8. “For example, when using Cocoa applications such as Mail or TextEdit to type text, I sorely miss the ability to do drag-and-drop text editing (rather than just cut-and-paste).”

It’s weird how this is screwed up. And many users don’t realize that you can drag-and-drop text in Cocoa apps. Select some text, mouse-down and hold for a second or two. Then drag. It works.

I wish it worked like Carbon drag-and-drop, though—it’s a pain to have to pause before dragging.