macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Mac OS X in a Nutshell

The Subtleties of Mac OS X

by Jason McIntosh, coauthor of Mac OS X in a Nutshell
03/04/2003

Earlier this year I had the pleasure of seeing a recent restoration of Fritz Lang's Metropolis, an epic sci-fi film from the Silent Era. Many of the techniques and motifs it employed proved highly influential in all the high-profile examples of cinema that would follow, but others have quietly slipped out of contemporary use. One particular example of cinematic antiquity that caught my attention was the film's use of an epigram, a succinct statement of the story's moral displayed as plain text right at the start.

Since I've been asked to write a promotional column for O'Reilly's new Mac OS X in a Nutshell book (of which I am one of the authors), I thought it'd be fun to frame it as an epigram of sorts; specifically, to give you a rundown of a few of my favorite lesser-known Mac OS X features, and ones that I wrote about extensively in the actual book.

Mac OS X Makes Application Development Extremely Accessible

Programming in Mac OS 9 and earlier usually meant one of two things: either knitting up simple little widgets in AppleScript or investing in the Mac OS coding priesthood through acquisition of costly programming environment software and Mac API documentation. Today, while AppleScript maintains its place as the in-house language that Apple touts to its power users, the opportunity for other kinds of programming has widened tremendously.

Developer Tools and Documentation

Metropolis still.

The Developer Tools package that ships with every new Macintosh and every boxed copy of Mac OS X includes a bundle of development software. The highlight of the bundle is Project Builder, an amazing integrated development environment which started life years ago at NeXT and was a polished and well-tested tool by the time it landed on Mac OS X's shores.

You also get a great deal of reference material in PDF and HTML format, including detailed documentation of the Cocoa and Carbon APIs and several books covering everything from the Objective-C language to network programming particulars.

Multiple Programming Languages

Beyond the GNU C compiler that Project Builder uses, Mac OS X comes with several powerful high-level languages that Unix systems have enjoyed for years, such as Ruby, Python, and Perl, my personal favorite. (And this is Perl running comfortably in its native Unix environment, as opposed to Mac OS 9's MacPerl, which uses many clever hacks to act as a sort of emissary of Unixhood in a strange land devoid of shells or environment variables.) While they're commonly known as scripting languages, with a little practice one can quickly write anything from little shell-shortcuts to full-blown Internet applications with any of them. And with projects such as CamelBones appearing on the scene, developers can even bridge these Darwin-layer languages into their Aqua applications (or vice versa)!

Darwin Is Not Just a Silent Back End

Metropolis still.

The majority of Mac OS X users will likely never peek below the liquid blue UI of the system's uppermost Aqua layer. However, churning beneath this surface is Darwin, an entire Unix operating system in its own right; with a little guided exploration of the sort that Mac OS X in a Nutshell offers, you can make your Mac do all kinds of strange and wonderful things.


Mac OS X  in a Nutshell

Related Reading

Mac OS X in a Nutshell
A Desktop Quick Reference
By Jason McIntosh, Chuck Toporek, Chris Stone

Network Services

Despite the fact that Apple sells a separate Mac OS X Server bundle, which comes with many friendly front-end applications for system and network administration, "plain" Mac OS X is still a fully functional modern Unix, and that means it's capable of running the same wide scope of network services that Unix is known for, including web serving with Apache, secure remote logins through SSH, and database services with MySQL. (See also Mac OS X in a Nutshell's online sample chapter, Web Publishing with a DAMP System to learn more about using an ordinary Mac OS X machine as a web application platform.)

Unix Software

You can obtain and install Mac applications in the usual fashion, whether popping in an off-the-shelf CD or downloading a double-click-and-go package from the Internet. The system's Darwin core, though, makes a whole world of Unix software also available--both command-line programs you can use through the Terminal, and graphical applications you can run with the X11 windowing system, itself a Unix program that is increasingly learning to play nice with Aqua. (In fact, as of this writing, Apple has made available a public beta of its own X11-on-OS X application.) Unix-based, Mac OS X-specific package managers, such as fink, can make installing and maintaining one's Unix software collection very easy.

Mac OS X's Text Handling Is Pervasively Sophisticated

Metropolis still.

One of my favorite subtleties of the operating system involves the way it treats its text. Obviously, personal computers and text have been best friends from the start--the keyboard has remained the chief data input device long after the first Macs made mice popular--but Mac OS 9's native text-editing tools were minimal at best. Mac OS X changes things significantly.

The Cocoa Text System

You can use Mac OS X's default text system the same way as any previous Mac or Windows text editor: click your mouse somewhere in the window to place the cursor and start typing. However, Mac OS X's Cocoa-based text system contains a great deal of rather sophisticated built-in features, such as standard commands for formatting, font-choosing, and spell-checking (against system-wide or user-specific dictionaries), and bristle with undocumented keyboard shortcuts that let you zip the cursor around the page without touching the mouse. (A starter tip: Try using Ctrl-A and Ctrl-E to move the cursor to the beginning and end of the current paragraph, respectively.) This is great for users, who can use these same text-entry tools and tricks across a wide variety of applications (including the system's self-contained text editor, TextEdit), as well as developers, who can very easily drop these text tools into their applications.

Unix Text-Editing Tools

Among modern operating systems, Unix has an especially close relationship with plain text files, with all kinds of crucial files, from email spools to program source to system configuration files, existing as plain text. Historically, Unix users tend to work with plain-text files whenever they work with text at all, usually using one of two programs: the simple (but somewhat obscure) vi, or the highly configurable (and mind-bogglingly baroque) emacs.

Mac OS X, being a proper Unix system, ships with both (and throws in a few others for good measure, such as pico, a friendly little editor). They run only in the Terminal (though you can find Aqua-friendly ports if you look) and have a steeper learning curve than TextEdit, but each has a wealth of features that can prove quite rewarding to master. Furthermore, their presence is definitely welcome for folks coming to Mac OS X from a Unix background.

Unicode and XML

Mac OS X handles Unicode and XML natively, making extensive use of both throughout the system. Of particular interest is Apple's "plist" XML application, which drives the Mac OS X open preferences system, allowing applications to integrate smoothly, and giving clever power users new ways to explore and modify system behavior.

So that's my two-page epigram of the 800-page monster known as Mac OS X in a Nutshell--the parts besides the giant command reference, the system preferences rundown, and all the other gory-detail chapters, at least. I don't think the book's special effects or soundtrack are as good as those in Metropolis, but it probably has a better index.


O'Reilly & Associates recently released (January 2003) Mac OS X in a Nutshell.

Jason McIntosh lives and works in and around Boston. He has co-authored two O'Reilly books, Mac OS X in a Nutshell and Perl & XML.


Return to Mac DevCenter.