Before the release of the original Macintosh, different applications running on the same computer in environments such as MS-DOS had wildly different interfaces. Some applications used the mouse; others used only the keyboard. Some applications were character-oriented; others created their own primitive window systems. This was a heavy burden on users and severely limited their overall productivity.
One of the primary goals of the original Macintosh was that different applications running on the same computer would have a consistent user interface. Consistency helps users because they don’t have to learn a new set of rules to perform the same basic operations as they move from application to application. (Think of how easy it is to drive different brands of automobiles — no additional training is required because they all have steering wheels, brakes, and accelerators that work the same way.)
The original Macintosh delivered this consistent user interface through a set of procedures stored in a read-only memory (ROM) called the Toolbox . Developers who wrote applications for the Mac, regardless of whether they were writing a word processor or a spreadsheet, were encouraged to use the Macintosh Toolbox to display the application’s user interface. This made things easier for users, because all applications behaved in the same way. It also made things easier for developers, because they did not have to reimplement things like scrollbars or menus for every application that they wrote.
Over the years, another advantage of the Toolbox became evident; as the operating system was improved and new features were added to the Toolbox, existing programs could get new functionality “for free.” When Apple moved from Macintosh System 6 to System 7, well-behaved applications could suddenly operate in a multiapplication environment. Likewise, when System 7 gave way to Mac OS 8, applications that used the Toolbox and followed its conventions were able to take advantage of Mac OS 8’s visual enhancements to the Macintosh interface. Indeed, the Toolbox was so integral to the Macintosh platform that many applications built without the Toolbox proved to be buggy and crashed a lot, and as a result, they were not successful in the marketplace.
Unfortunately, the reliance on the Toolbox came with a price: once a function call was placed in the Toolbox, Apple could not remove it, for fear of breaking existing applications. Over the years, the Toolbox became cluttered with many slightly different versions of the same function, some of which had been developed long ago and had inherent problems. The Toolbox was, in a word, bloated.
With the move from Mac OS 9 to Mac OS X, Apple revised the Toolbox and removed many of the early application programming interfaces (APIs). Apple gave the name Carbon to the remaining Macintosh APIs, which are natively supported by the Mac OS X operating system. Applications that use the original “Inside Macintosh” Toolbox APIs can be run on Mac OS X only inside the Macintosh “Classic” environment, which is essentially a copy of the Mac OS 9 operating system that runs within the Mac OS X environment.
With Mac OS X, Apple also introduced a new set of APIs known as Cocoa — a set of APIs for the 21st century. Because these APIs were developed independently of Apple,[1] they are fundamentally different from the original Macintosh APIs. Whereas the Toolbox and Carbon APIs are in the C programming language, the Cocoa APIs are written in Objective-C, an easy-to-use, object-oriented programming language that is well suited to writing GUIs.[2] The Cocoa environment provides consistency and ease of programming that are unparalleled among the other programming environments available today.
Aqua’s consistency means that windows in different applications have the same appearance and functionality; for example, mouseclicks and drags perform the same kinds of actions, and common menu commands are in the same place and have the same names, the same keyboard equivalents, and so on. The overall look and feel of all Mac OS X applications is the same. Contrast this with the haphazard way that interfaces to some Microsoft Windows applications have been developed over the years, and you’ll begin to see why we like Mac OS X so much.
Mac OS X and Aqua put you in charge of your desktop and its windows. Through preference settings, info panels, resize controls, icon dragging, and other means, you can change the size, visibility, and location of almost every object on your desktop, decide when your Dock is visible and what it looks like, change the size of most text, and even determine which icons represent your folders.
With Aqua, the primary instrument that you use to interact with the computer is the mouse. Compared with the computer’s keyboard, the mouse seems more natural for most users, because using the mouse is a better analogy for how we interact with objects in the real world. For example, if a window on the desktop represents a piece of paper on a desk, it’s more natural for a user to move that window by dragging the window to a new place on the screen than by typing a sequence of keyboard commands.
Unlike previous versions of the Macintosh operating system, however, much of Mac OS X can also be controlled from the keyboard. Many common commands have keyboard equivalents, such as Command-X for Cut and Command-V for Paste, that will help you use applications more efficiently. Thus, people who lack the dexterity or the vision required to accurately use a mouse can still benefit from the Mac OS X environment by using the keyboard (in particular, the tab and arrow keys). Universal access and speech features are also available in Mac OS X.
Get Building Cocoa Applications: A Step by Step Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.