The Subtle Dangers Of Distributed Objects

Introduction: I wrote this as part of a reply on Apple’s bonjour-dev mailing list, then decided it might be worth publishing more visibly. I’ve found that Cocoa’s Distributed Objects technology is immediately attractive to many developers, while those who’ve used it end up finding that it’s much more complex than it looks. But I haven’t seen much written about the caveats of using it. I am not saying “don’t use DO” or “DO is broken”! Read more…

Network Barbie Says “Asynchrony Is Hard!”

You can’t avoid asynchrony when writing network code, since operations can take an arbitrary amount of time, and often do. To keep the app responsive it has to be able to get other things done while a slow operation is in progress. My first exposure to network programming was in Java, whose approach to asynchrony is to use threads. Lots of ’em. The API calls are [almost] all blocking, so you run them on background threads. Read more…

GeekGameBoard

Santa has an early Xmas present for all you good Leopard programmers: GeekGameBoard, a new piece of sample code by the anonymous engineer elves at Apple. [Update: GeekGameBoard is now an open-source project hosted at bitbucket.org GeekGameBoard is an example of using Core Animation to present the user interface of a board or card game. It implements a small framework for implementing such games, with domain-specific classes like “Grid” and “Piece”, and examples of several game definitions built on top of the framework. Read more…

Uncle Jens’s Coding Tips

Ever since Brent “NetNewsWire” Simmons posted his Thoughts On Large Cocoa Projects the other week, I’ve wanted to add some of my own tips. I’ve worked on some big projects (iChat, Apple’s Java runtime, OpenDoc) and have sometimes had to find my way around in others (Safari, Mail), so I know what Brent means when he says:

There’s no way I can remember, with any level of detail, how every part of [my app] works. I call it the Research Barrier, when an app is big enough that the developer sometimes has to do research to figure things out…

It’s been said many times that “the main person you’re writing comments for is yourself, six months in the future.” It’s always a good idea to keep that shadowy figure in mind while you code. Here are some other techniques I’ve found invaluable:

Read more…