Making Book

Two volumes get you up to speed with NEXTSTEP programming

by Gregory H. Anderson

Before almost anyone had a NeXT computer, thousands had purchased The NeXT Book by Bruce Webster. Quickly followed by Doug Clapp's The NeXT Bible, these served as good general introductions to NeXT and NEXTSTEP. But until recently, hard technical information was limited to NeXT's own technical documentation (now published by Addison-Wesley). Critical mass in the market has finally spawned a whole round of in-depth books about NEXT-STEP. This month, NeXTWORLD reviews two introductions to NEXTSTEP programming. We'll sample other titles in future issues.

The acid test for an introductory programming book is whether you can give it to a new employee, sit her in front of a machine for a few weeks, and watch her bloom, with minimal assistance, into a competent programmer. By that standard,NEXTSTEP Programming Step One: Object Oriented Applications, by Simson L. Garfinkel and Michael K. Mahoney, is an unqualified success.

Using simple, progressive, confidence-building examples, Garfinkel and Mahoney quickly cover all the basics: Windows, Menus, Views, delegates, events, responders, nibs, and Projects.

Newcomers to NEXTSTEP will quickly learn why seasoned programmers find the OS so exciting and why a copy of this book is included in every Developer Release box.

Both the sample code and the narrative emphasize good programming habits. For example, the discussion of coherence between an interface and its controller code making decisions on the basis of run-time states, rather than preprogrammed information is vital to maintaining large object-oriented systems. To reinforce this concept, the authors write a poorly constructed method to set the radix of a calculator, then show how the implementation can be improved with run-time object messaging.

But even a good programming book isn't perfect. It's difficult to justify an entire chapter on threads when several more useful topics are omitted (see below). Also, since this book will provide many programmers' first exposure to object-oriented programming, a short background chapter on object-oriented design would be valuable.

Object-oriented design is covered in NEXTSTEP Programming: Concepts and Applications, by Alex Duong Nghiem, but that is the only area in which this book is superior to Garfinkel and Mahoney's. Much of the conceptual material is presented without context, and the examples neglect many NEXTSTEP features.

InterfaceBuilder (IB) is not all there is to NEXTSTEP programming, but it certainly helps get programmers hooked. With that in mind, it is unreasonable to force readers through several hundred lines of programmatic objects and a private event-processing loop before introducing IB. Even the common user- interface objects TextFields, Buttons, Sliders are explained with program code instead of IB examples.

By the end of chapter four, you get the feeling that if Nghiem sold cars, he would rather show you the circuit diagrams for the antilock braking system than take you for a test drive, run the speedometer up to 60, and stand hard on the brakes. Microsoft Windows and Macintosh programmers could be excused for bailing out at this point, wondering what the NEXTSTEP fuss is all about.

The sample programs are not well developed and include some questionable code. The Money example, which implements a foreign-exchange calculator, assumes how many rows the form will contain and allocates static storage to support it. It would be more instructive and more coherent to set up a secondary matrix for the exchange rates, tie it to the primary form, and eliminate the hard coding.

Nghiem skips many fundamental topics that are covered in the Garfinkel and Mahoney book, such as automatic menu-cell updating, Services provisioning, icon building, setting timed-entry events, using categories as an alternative to subclassing, and understanding the distinc- tion between windows and panels. Given his obsession with writing code in instances when InterfaceBuilder could do the work, it is surprising that the book does not include a sample disk.

Both programming books ex-clude information that would address growing complaints about the lack of extensibility in NEXTSTEP applications: custom palettes, dynamic code bundles, the run-time system, and distributed objects. Ironically, a good model already exists: InterfaceBuilder. An informed discussion of how IB works internally would cover most of these topics and help programmers appreciate how open-ended design provides user empowerment.

Gregory H. Anderson is president of Anderson Financial Systems, a Springhouse, Pennsylvania developer of custom Wall Street trading applications.

Since one of the books reviewed was co-authored by a NeXTWORLD editor, this review was written without imput from the magazine staff.

NEXTSTEP Programming: Concepts and Applications

Alex Duong Nghiem

PTR Prentice-Hall, 1993, 604 pages, ISBN: 0-13-605916-3

2 Cubes

Accomplishes the seemingly impossible: makes NEXTSTEP programming seem boring. Missing fundamental information and uses uninspired examples.


Prentice-Hall Professional Technical Reference Division, P.O. Box 11073, Des Moines, IA

50381-1073. 515/284-6751.

NEXTSTEP Programming Step One: Object-Oriented Applications

Simson L. Garfinkel and Michael K. Mahoney

Springer Verlag New York, 1993, 631 pages (with diskette), ISBN: 0-387-97884-4

4 Cubes

A superior tutorial for beginning NEXT-STEP programmers. Crisp writing, clean organization, excellent examples. Includes diskette with source code.


Springer-Verlag New York, P.O. Box 2485, Secaucus, NJ 07096.

201/348-4033, 800/777-4643.