Editor's note: In this first part of a two-part series, Simson Garfinkel and Michael Mahoney explain why Cocoa and Mac OS X aren't nearly as revolutionary as they are evolutionary -- and still in the process of refinement. The story begins with Apple's genesis in the 1970s and takes you through key events up through 1993, when NeXTSTEP began to flounder. In Part Two (Friday, May 10), Simson and Michael pick up the story with the Star Trek project and bring you to the current iteration of Mac OS X.
If you are a Macintosh user, you've almost certainly heard of Mac OS X, Apple's "revolutionary" new operating system that now ships standard on all Macintosh computers. And if you know anything about OS X, then you know that to call the operating system "revolutionary" is a huge misnomer -- while Mac OS X brings a whole range of exciting new capabilities to Macintosh users, it's really much more an exercise in evolution than revolution.
If "X" stands for that which is unknown, then Apple's next-generation operating system is fundamentally misnamed. Unlike that other "X" operation system, Microsoft's Windows XP, very little about Mac OS X is unknown or unpredictable. Indeed, some of the most innovative goodies in OS X are actually mature, stable technologies that have been painstakingly developed over the past 15 years by Apple, NeXT Computer (which Apple acquired in December 1996), and the open source community as a whole. The real pleasure that is Mac OS X comes from the seamless integration of these technologies in a single desktop.
To be sure, Apple has taken great pains not to annoy the Macintosh faithful. The Mac OS X "Aqua" interface looks a lot like the Macintosh interface that tens of millions of people have come to know and love. Along the top of the monitor is the ever-present menu bar with the Apple in the top-left corner. There are pull-down menus, pop-up buttons, scroll bars, and even Apple's Finder.
But instead of sitting atop the Macintosh Toolbox, OS X is built upon a Unix kernel. Indeed, Mac OS X ships with an entire BSD-based Unix operating system called Darwin. There is a "Terminal" application, a copy of the GNU C Compiler, emacs, make, awk, lex, yacc, and even perl (version 5.6.0), all of which combine to make it a proficient open source development platform. But for many programmers, the real excitement of Mac OS X will be programming with “Cocoa.”
Writing programs for Cocoa is both similar to and yet significantly different from writing programs for other programming environments. Like other modern application-development environments, one writes Cocoa programs by building systems of related but distinct parts, or objects, and connecting them together to form an integrated whole. Confining different aspects of a program to different pieces makes those pieces easier to design, implement, debug, and reuse. This is what is known as object-oriented programming (OOP).
But unlike development systems based on the C++ programming language, such as Microsoft’s Application Foundation Classes and CodeWarrior’s PowerPlant, Cocoa is built on top of the Objective-C programming language -- a language that’s simultaneously simpler than C++ and yet better suited to creating graphical user interfaces. Whereas most people find programming in C++ a chore, most Objective-C programmers find the language to be a joy.
Cocoa embodies the principles of object-oriented programming from its user interface down to its very core. This greatly simplifies the task of building applications for Mac OS X. The downside is that it makes the Cocoa environment very different from the environments to which most programmers are accustomed. As a result, there’s something of a learning curve -- a curve that can be pretty steep if you don’t have competent instruction.
While Cocoa is a relatively new offering from Apple, the underlying operating system on which Cocoa is based is more than a decade old. Although today Cocoa is an integral part of the Macintosh operating system, much of what is now called Cocoa dates back to the NeXTSTEP OS developed by NeXT Computer, Inc., from the late 1980s through the mid-1990s.
This is very important: Cocoa is not some new fad technology Apple is trying out today but might soon discard: it is a mature, time-tested development environment that has been used and improved by many thousands of programmers over more than a decade.
Mac OS X can actually run at least four different kinds of programs right out-of-the-box. In addition to Cocoa applications, OS X can run an incredibly wide range of legacy Macintosh applications in its so-called "Classic" mode. These applications have exactly the look-and-feel of applications running on Mac OS 9 -- in fact, Mac OS X actually runs them inside a virtual Mac OS 9 operating system.
Mac OS X can also run new "carbonized" applications based on a limited set of the Macintosh Toolbox API that is native under the new operating system. And finally, like any modern operating system, OS X can also run programs written in the Java programming language.
To understand how all of these different technologies fit together, and to understand the grand unification that is Mac OS X today, you really need to know the history of Apple, the Apple II and III, Lisa, Star Trek, Steve Jobs, John Sculley, the Macintosh, and a company called NeXT.
At the bottom of every press release that Apple Computer sends out today is the sentence "Apple ignited the personal computer revolution in the 1970s with the Apple II and reinvented the personal computer in the 1980s with the Macintosh." Powerful words to be sure; all the more telling because they are true.
The Apple II computer wasn't the first personal computer, but it quickly became the most popular. The computer came with a built-in BASIC interpreter, great color graphics, and enough RAM to hold an application and some data. The Apple II could display 24 lines of 40-column uppercase text, it had 8 expansion slots, a cassette interface, and a full-size 52-key keyboard. Shortly after its introduction, Apple introduced the Disk II, the world’s first affordable floppy disk system.
Many schools found that buying a few Apples and putting them on a table in a windowless storage room was a cheap way to add "computing" to their curriculum. Soon programs like Apple Writer were letting students do basic word processing, a revolution in the 1970s! (Upper-case letters were displayed with reverse video.) But what really made the Apple II a breakthrough computer was an application called VisiCalc, the first spreadsheet, which was released in October 1979.
|If you have an anecdote to contribute to this story, please chime in.|
VisiCalc was a godsend to independent accountants and financial analysts who could sneak a few Apple computers into their offices. After all, it was a computerized spreadsheet -- no longer did these people have to mindlessly add up the same numbers again and again with their calculators! Unfortunately for both Apple and the program's publisher Software Arts, VisiCalc was a business application trapped on a hobbyist computer.
With its graphics and an RF interface that made it possible to display text on a standard television, the Apple II was great for playing games, but it was downright difficult to take the Apple II seriously in an office. Between 1978 and 1983, Apple's sales grew at the rate of 150 percent a year -- but those sales were almost entirely based on the home and education markets. Apple’s sales force knew that the big dollars to be made in desktop computing were in the business world. To tap those dollars, Apple needed a business computer. And that computer was the Apple III.
Equipped with between 96-256K of RAM, a 1.4Mhz 6502A, an integrated floppy disk, and an optional 5MB hard drive, the Apple III should have been an instant success. Unfortunately, the system was plagued with problems from the very beginning. The machines ran hot and frequently failed. The III was supposed to be able to run Apple II programs, but the emulation was unstable and uneven.
The system was introduced in September 1980, pulled from the market shortly thereafter, and reintroduced in the fall of 1981 -- just in time to be smashed by IBM's newly-introduced Personal Computer.
IBM had designed its computer from the ground up to be a business machine. The machine had a crisp 25-line, 80-column display with both uppercase and lowercase letters, it was built like a tank, and it was even sold by the trusted IBM sales force. It had a 16-bit microprocessor that could handle up to 640k of memory ("enough for anybody," we were told). The IBM PC sold. Just two years after it was introduced, IBM's sales on personal computers passed Apple's.
Apple went back to the drawing board and tried once again to create a business computer. This time the plan was revolution, not evolution. Its next attempt at a business machine was the Lisa -- a 68000-based computer with a graphical user interface, mouse, floppy drive, desktop-based operating system, and seven applications: LisaDraw, LisaWrite, LisaCalc, LisaGraph, LisaGuide, LisaLisa, and LisaProject. The whole system came with a 5MB external hard drive and cost $9,999. Introduced in January 1983, Lisa was a high-end machine that never caught on.
Perhaps the problem was management. Apple was started in a garage in 1976 by two kids -- Steve Jobs and Steve Wozniak -- who really had nothing in the way of professional experience. So in 1983, Steve Jobs called up John Sculley, then at Pepsi-Cola, to be president of Apple. "If you stay at Pepsi, five years from now all you'll have accomplished is selling a lot more sugar water to kids," Jobs reportedly told him. "If you come to Apple you can change the world."
Of course, in order to change the world, Apple needed to have a computer that people would buy. Convinced that Lisa was a flop, Jobs led a "pirate crew" of engineers (assembled by Jef Raskin) to set out to make a low-cost computer that could be used by anybody. The project became Jobs' pride and joy -- a project that immersed him while Sculley surveyed the rest of the company. A year later, Apple introduced Macintosh with its infamous "1984" commercial played during the 1984 Super Bowl.
Sculley may not have changed the world, but he certainly changed Apple, which even the most faithful acknowledge was a mess at the time -- a place the neighbors in Silicon Valley were increasingly calling "Camp Runamok." Sculley simplified Apple’s product lines and slashed costs. Eventually Sculley decided that the source of Apple's problems was Jobs' erratic management style. He gradually stripped Jobs of his day-to-day responsibilities, and finally relieved Jobs of his duties as chairman of Apple's board.
Jobs left Apple with a few hand-picked engineers -- his closest allies -- determined to set up a new computer company and do it all again. He called that company NeXT, as in "the next big thing."
Every successful company has a driving ideology. At NeXT the ideology was to do everything right -- or at the very least, not to repeat any of the mistakes Apple had made.
The Macintosh operating system had always been plagued by reliability problems. NeXT solved this problem by basing its computer on Unix, the most reliable operating system that had ever been created. Macs were widely used in publishing -- the Macintosh practically created the field of desktop publishing -- and yet fonts on the Macintosh screen were never quite the same as they would appear on the Apple LaserWriter. NeXT solved this problem with Display PostScript, a system that let the computer use exactly the same fonts and drawing commands on the screen and its laser printer.
The Macintosh toolbox was great, but it was exceedingly difficult for programmers to make relatively simple modifications to buttons, scrollbars, and other objects displayed on the screen. NeXT solved this problem through the use of object-oriented programming and a new computer language called Objective-C.
But NeXT wasn't just a software company -- Jobs was also obsessed with building hardware. And this proved to be the company's downfall.
Obsessed with the idea of Zen perfection, Jobs had his designers create the first NeXT computer in the shape of a cube -- a heavy magnesium cube that was expensive to produce and difficult to ship. Convinced that networked computers were the way of the future, Jobs banned the floppy disk from NeXT's first machine -- a decision that made distribution a challenge for software developers.
Convinced that CD-ROMs were a passing fad but that rewritable optical storage was the way of the future, Jobs signed a deal with Canon to equip every NeXTcube computer with a 256MB magneto-optical drive -- a drive that proved to be finicky, unreliable, noisy, and incredibly slow.
The NeXT computer had a proprietary keyboard, proprietary mouse, proprietary video display, and even a proprietary laser printer. In a world that was increasingly moving to commodity computers running third-party operating systems like Windows, NeXT was retrograde.
Despite these caveats, NeXT actually managed to sell more than 50,000 of its workstations. Some companies, like the upscale Silicon Valley-based Alain Pinel Realtors, bought the black computers because they were exquisitely attractive. But the majority of the computers were sold for a different reason -- because businesses found it incredibly easy to develop custom applications using the NeXTSTEP operating system.
NeXT machines found their way into the banking, health care, and telecommunications arenas -- all industries that base their competitiveness on their ability to manage information and bring out new information products. In a world where time-to-market was king, NeXTSTEP literally made companies more profitable.
But as NeXT's sales slowly ramped up, the company heard the same message again and again from its customers: "Love the software, hate the hardware."
The year was 1992 and a lot of people were beginning to think seriously about the difference between selling hardware and selling software. Microsoft was just beginning to storm the world with Windows version 3 -- a graphical operating system that had the side benefit of helping Microsoft sell its graphical application programs.
Sun Microsystems had split its company into "planets," one of which was a software division that had ported the Solaris operating system to Intel-based hardware. There was even talk of “free” operating systems like Linux and BSD Lite. The world was starting to change.
That year, NeXT announced it was going to port the NeXTSTEP operating system from its Motorola-based “black hardware” to Intel-based “white hardware.” More amazing yet -- the system actually worked.
The following year, NeXT got out of the hardware business and got into the porting business, cutting deals with Data General, Sun, and Hewlett-Packard, all of which soon had versions of the NeXTSTEP operating system running on their hardware. The company even started on a port of the NeXTSTEP application framework to Windows.
It was the right idea, but the wrong time. By 1993 companies could no longer justify going with an oddball operating system simply because it was faster to develop application programs. Although NeXT Software had some customers, the company floundered.
In Part Two, Simson Garfinkel and Michael Mahoney take you inside the secret mission, dubbed Star Trek, to port the Macintosh operating system to Intel-based hardware. Then they cover the port of the NeXT OS to the PowerPC, leading to the birth of Mac OS X.
Simson Garfinkel is a developer with 24 years of programming experience, the author or coauthor of 14 books, an entrepreneur, and a journalist. He is the founder and Chief Technology Officer of Sandstorm Enterprises, a Boston-based firm that develops state-of-the-art computer security tools.
Michael Mahoney is Dean of the College of Engineering at California State University, Long Beach, where he is also a Professor of Computer Engineering and Computer Science.
Return to the Mac DevCenter.
Copyright © 2009 O'Reilly Media, Inc.