X
Business

Apple: Two routes to Mac OS X

News analysis: Apple's director of Mac OS product marketing says programming with Carbon or Cocoa can bring the same gains to end users.
Written by Adam Gillit, Contributor
In an all-out effort to attract developers and applications to its new operating system, Apple Computer Inc. has provided two ways to program for Mac OS X. But how do the results match up for end users?

According to Apple Director of Mac OS Marketing Ken Bereskin, both routes can provide identical experiences for Mac fans seeking software that exploits all the capabilities of the new OS. Developers, meanwhile, face a more pronounced choice: retrofitting previous code to Mac OS X or building from the ground up.

When creating Mac OS X applications, developers can rewrite existing OS 9 code with new Carbon APIs or start from scratch and write new code with Cocoa APIs and frameworks. Both avenues provide developers with compelling reasons to use them, but there has been little discussion about the differences between the competing technologies.

Although the new operating system is able to run legacy OS 9 applications, programs written with Carbon or Cocoa are able to take advantage of features like protected memory space, preemptive multitasking and the Aqua GUI. In addition, users can access the BSD core through a command line interface, and run Java applets natively.

At this point, most software is available only for the Classic OS 9 environment. Apple has posted a list of OS 9 software that works in the Classic Environment, and a list of software that is OS X-optimized.

Apple realized early on that applications for Mac OS X would be hard to come by, especially compared with the wealth of software for the current Mac OS. According to Bereskin, Carbon represents the shortest distance between those two points: "If you look at the tens of thousands of applications that have been written for the Mac, we want those on Mac OS X, and we want them really, really quickly. The fastest path for those apps obviously is the Carbon process."

According to Apple (aapl), Carbonizing a Mac OS 9 application to exploit Mac OS X's new features requires developers to rewrite 10 percent to 30 percent of their code. "What we're providing with Carbon is a path to take those APIs and functions and that application code to run as a completely modern app within the X environment," Bereskin said.

However, simply modifying the code isn't enough to allow the software to take advantage of all Mac OS X's advanced features.

"A developer who is Carbonizing their application can do an absolute minimalist job, in which case they will get all of the baseline capabilities of Mac OS X in terms of being a modern process with a basic Aqua user interface," he said. "If they stop there, they certainly won't enjoy all the fruits of the new technologies that Mac OS X provides."

"New concepts -- such as Services and the Font Panel -- and a small number of other things have no API equivalent in Mac OS 9," Bereskin said. "Carbon apps have to do work. They don't get those things for free." These features -- and others such as internal multithreading -- require programmers to add new code to their applications to access them.

"The general case is we are able to add technologies into Mac OS and have Cocoa applications get those benefits for free. Carbon developers need to do a revision to take advantage of those new APIs."

While Cocoa is sometimes referred to mistakenly as a programming language, it is actually a set of frameworks and APIs that can be called from either Objective C or Java. It has been developed from the base established for OpenStep, the operating system Apple purchased with NeXT Software Inc. in late 1996 to form the foundation of the next-generation operating system that would eventually be named Mac OS X.

"Cocoa is such an amazing next-generation technology because it's based on an object-oriented design," Bereskin said. "Cocoa has had years and years and years of optimization to build a series of frameworks that truly meets the needs of application developers that are presenting into very rich, compelling user interfaces.

"The application developer deals with concepts like, 'I have an application. It knows how to create documents. Documents rely on windows. Windows, if it's a textual document, use text capabilities.'

"The application developer really doesn't worry about the implementation of any of those things because they are built automatically into the Frameworks. They're just saying, 'Hey system, I want to create a word processing document in a window that has scrollbars and a toolbar at the top.' "

By providing the building blocks of applications from within the Cocoa frameworks, Apple is ensuring that users will encounter the same behavior no matter which application they use.

This structuring allows developers rapidly to put together applications that access all the features of OS X. "Cocoa developers could literally be ten times more efficient and more productive in building software." If, in the future, Apple should decide to release OS X for x86 or other platforms, applications developed with Cocoa will work on the new platforms.

Users are wondering what differences they will notice when using applications developed with Carbon or with Cocoa. Bereskin claims that they should notice few, if any, differences at all.

"A Carbon developer could develop an app that is indistinguishable from a Cocoa app. A great Carbon application can deliver virtually all of the capabilities that Mac OS X has." Cocoa applications, by virtue of being developed exclusively for OS X, can deliver all the OS' capabilities.

Editorial standards