Tech —

The legacy of NeXT lives on in OS X

NeXTSTEP technologies still fuel Macs, iPhones, and iPads 16 years later.

The legacy of NeXT lives on in OS X
Aurich Lawson

In the 1990s, Apple struggled to bring the original Mac OS—originally written in 1984 for the resource-constrained Macintosh 128K machine—up to modern operating system standards. The story of how OS X came to be is thrilling in its own right, but suffice it to say that Apple ended up buying Steve Jobs' second computer company, NeXT, and using its NeXTSTEP operating system as the basis of a new generation of Macs.

Apple announced the acquisition of NeXT on December 20, 1996, noting it wanted NeXT's object-oriented software development technology and its operating system know-how. As part of the deal, Jobs came back to Apple, eventually taking over as CEO and making the company into the consumer electronics giant it is today. Sixteen years later, several technologies developed or championed by NeXT still survive in OS X and in its mobile cousin, iOS. This week, we remember some of those technologies which continue to power key features of Apple's devices.

UNIX

We consulted several developers with knowledge of both NeXTSTEP and OS X; they universally agreed that one crucial feature of NeXTSTEP that made OS X and iOS what they are today is its underlying UNIX roots. Beneath all the slickly styled windows, icons, scrolling lists, and buttons sits a rock-solid, certified UNIX operating system.

UNIX was originally conceived in 1969 by Bell Labs' Ken Thompson for the PDP-7 minicomputer. Its development throughout the early '70s led to the development of the C programming language by Thompson's colleague Dennis Ritchie. UNIX at its core was meant to be a powerful operating system for the massive computers of the day, but it could also be easily programmed and controlled by developers using a simple video terminal.

Underneath OS X's pretty graphical interface is a version of the UNIX operating system.
Enlarge / Underneath OS X's pretty graphical interface is a version of the UNIX operating system.

That same basic system powers both the Mac sitting on your desk and the iPhone resting in your pocket. By basing OS X—and later, iOS—on UNIX, Macs were finally able to enjoy important operating system features like protected memory, pre-emptive multitasking, and daemon-based services.

Graybeards may remember the days of the classic Mac OS. Some errant Photoshop plug-in could crash your entire Mac, or the Mac OS might come screeching to a halt while you dug through menus looking for some arcane command. Protected memory means that most app crashes on OS X would no longer take your whole machine down with them. Pre-emptive multitasking means that your computer could keep chugging along doing other tasks even while one application might be tied up using some of the system's resources.

With pre-emptive multitasking, UNIX-based operating systems can also use daemons, small programs that continually run in the background. Daemons sit back and wait for a signal to spring into action; they handle most of the background tasks like connecting to networked printers on your Mac or playing music while you play Words With Friends on your iPhone.

In addition, because OS X is fully POSIX-compliant—a defined set of standards that all UNIX operating systems adhere to—porting freely available tools or open source software to OS X is (relatively) straightforward. For instance, the popular FFmpeg audio/video encoder, originally developed for Linux, also powers some video encoding apps for OS X, such as Handbrake.

Objective-C

The Objective-C programming language was used to develop software for the NeXTSTEP operating system, and it carried on to OS X and iOS. It's an object-oriented programming language developed as a superset of the original C language so that both object-oriented Objective-C code and procedural C code can be combined in the same program.

Steve Jobs was a huge proponent of object-oriented programming and he largely built NeXT around giving developers tools to program in this style. At a high-level, object-oriented programming uses a set of "objects" which are defined in code to have certain characteristics and capabilities. A developer can then mix and match these objects, passing messages from one to the other in order to accomplish a particular task. Developers don't need to know the underlying code of the objects, only what messages the object responds to and what responses it can generate.

(Imagine an "adding" object that you could send a message containing two numbers; its response might naturally be the sum of those two numbers.)

While Objective-C has its detractors—mainly for its verbose, Smalltalk-style syntax—Apple has worked to improve the language by adding features like dot syntax, blocks, and automatic reference counting. The company also significantly improved compiled code by replacing the traditional C compiler gcc with Clang and LLVM. (A simple Objective-C program is below.)

// "Hello World" program example
// adapted from http://cupsofcocoa.com/
// by Rob @tolar Haining

#import <Foundation/Foundation.h>

int main(int argc, char *argv[]){
   @autoreleasepool {
      NSDate *now = [NSDate date];
      NSLog (@"Hello, World! The current date is: %@", now);
   }
   return 0;
}

Jobs said in a 1995 interview (while still at NeXT) that object-oriented development would revolutionize how we created software, compared to the previous 20 or 30 years. The developers we spoke to tended to agree that his prediction came true.

"Objective-C directly inspired Java and C# and has changed how almost everyone programs, even if they’re not writing for Apple’s machines," said developer Wil Shipley, who got his start writing software for NeXT computers. "We saw the invention of the fricking World Wide Web on NeXTSTEP. It's not a coincidence; it was a machine that was a dream to program for."

Shipley also noted that several apps we still use today on OS X were inspired by or adapted from software originally developed for the NeXT platform, including Numbers (née Parasheet), Keynote (née Concurrence), Pages, and OmniGraffle (née Diagram!).

You can see the roots of Apple's Numbers, the spreadsheet app from its iWork suite, in ParaSheet for NeXTSTEP.
You can see the roots of Apple's Numbers, the spreadsheet app from its iWork suite, in ParaSheet for NeXTSTEP.

AppKit framework

In addition to using the Objective-C language, NeXT also developed collections of pre-built objects which developers could use to build software. Many of these were collected in the AppKit framework, which Apple adapted into Cocoa for OS X and later into Cocoa Touch for iOS. These frameworks help eliminate some of the tedious, repetitive coding typically required in application development, letting developers focus on core functionality and usability.

Cocoa and Cocoa Touch frameworks include all the basic building blocks and functionality necessary for most modern software, but Cocoa's NeXTSTEP roots are still apparent in object class names like NSArray, which are still prepended with the "NS" prefix.

"I have always believed that if you give programmers a boost, you’re going to see amazing stuff," Shipley explained. "What would the iPhone (and iOS) be today without the SDK that came [in 2008]? I’d argue it'd just be a iPod—still a great seller, but not something that has changed every part of our lives."

Developer Mike Lee, who cut his teeth with Shipley at Delicious Monster and at Apple in Developer Relations before striking off on his own at New Lemurs, explained the connection between OS X's and iOS's UNIX underpinnings, Objective-C programming language, and Cocoa frameworks this way:

There is a relationship between most of the things listed here. The computer is UNIX, and C is the language of UNIX. Objective-C is a human-oriented language [variant], Smalltalk implemented in C. The AppKit and its Cocoa kin let us talk to the user with the same ease with which we talk to the machine. We [developers] are the diplomats between people and computers.

Channel Ars Technica