Cocoa and Carbon

OS X can run two different kinds of programs, each with different characteristics: Cocoa and Carbon.

The explanation involves a little bit of history and a little bit of logic. To take full advantage of Mac OS X’s considerable technical benefits, software companies had to write new programs for it from scratch. So what should Apple have done—sent out an email to the authors of the 18,000 existing Mac programs, suggesting that they throw out their programs and rewrite them from the bottom up?

At most big software companies, that suggestion would wind up on the Joke of the Week bulletin board.

Instead, Apple gave software companies a choice:

Here are some of the advantages Cocoa programs offer. May it clear up any confusion you have about why certain features seem to be present only occasionally.

You may remember from Chapter 1 that the title bar of every Finder window harbors a secret pop-up menu. When you Control-click it (or right-click it, or two-finger click it, or ⌘-click it), you’re shown a little folder ladder that delineates your current position in your folder hierarchy. You may also remember that the tiny icon just to the left of the window’s name is actually a handle you can drag to move a folder into a different window.

In Cocoa programs, you get the same features in document windows, as shown back in Figure 2-5 (Dragging from the Title Bar). By dragging the tiny document icon next to the document’s name, you can perform stunts—like dragging that little icon to the desktop or to the Dock icon of a different program for opening—right from your document’s title bar.

For the most part, it’s possible to ignore the Unix that beats within the heart of OS X. But every now and then, a little reminder pokes its head up through the fields of gradient gray—and here’s one of them.

Although you’ll never see it mentioned in the instruction manuals for Cocoa applications (if there even were such things as instruction manuals anymore), most of them respond to certain keystrokes left over from the NeXT operating system, which was OS X’s ancestor. If you’re a card-carrying member of KIAFTMA (the Keyboard Is Always Faster Than the Mouse Association), you’ll love these additional keyboard navigation strokes:

Four additional keystrokes duplicate the functions of the arrow keys. Still, as long as you’ve got your pinky on that Control key…