I have been pounding away at code examples in "Cocoa Programming for Mac OS X" (ISBN 0321213149), a book by Aaron Hillegass. (For anyone who's interested, it's certainly so far an excellent book for people who, say, know some C or Java, but don't know Objective C or even anything much about Mac OS X.) I want to make an observation about Mac OS X which I think is neat, but I had better preface it with a short description about my Java experience, just in case it turns out that the observation is not that neat, and, in fact, I've been doing things the hard way all along.
I have written quite a few lines of Java code over the years, the majority of which has been console-based tools and applications. However, I've written the odd toy, and collaborated on a single substantial project, using Swing to create graphical user interfaces (GUIs) for Java programs. Further, I've never been a fan of great big, hulking integrated development environments (IDEs). And that's not through a lack of trying them out, starting way back with Sun's Forte. I'm more of an emacs kind of guy, and even in the large Swing application, we built the GUI by hand—that is, by typing in the code to build the GUI bit-by-bit. It was, well, awful.
Enter Apple's Xcode. Xcode is a great big, hulking IDE. But it's free, and it comes with good documentation, and Hillegass's book has been stepping me through it. There are (some) emacs key bindings in its editor, and they're getting me through the withdrawal. Finally, here's the neat bit. There's a tool called Interface Builder for putting together the GUI for applications. Nothing remarkable there. Instead of generating code to recreate the GUI at run-time, though, what Interface Builder does is this: it allows you to construct the actual object hierarchy for the GUI in a drag and drop fashion (which is probably what the Java IDEs are doing as well), and then just serialises that object to a file for reconstruction at run time! That is, it doesn't translate the object hierarchy you built into code to reconstruct that hierarchy, which is the only way I've ever seen a Java IDE do it, it just serialises the actual instance of the object hierarchy you've just built on-screen (or "archives" it, in Apple-speak) for deserialisation ("unarchiving") at run-time. I think that's neat.