Objectionable C
I've been playing around some more with Cocoa and Core Data lately. Trying to put my Microsoft Money where my mouth is and write a simple personal finance program. I just want simple rules-based sorting of transactions and some basic pie chart in a simple Mac-like interface. Checking statements should be just like checking email. Anyway.
All-in-all, the experience has not been entirely pleasant. I've tried to remain objective about this. I know learning something new can be painful. I know I can be a curmudgeon about these things. But I've just come to the conclusion that Objective C and Cocoa are just not up to par.
Apple has done a great job of making it very easy to develop a View (in Interface Builder), and they lately have taken a lot of the pain out of the Model (with Core Data). I will say the Core Data is very nice. It's a simple-but-elegant persistence framework for OS X applications. Think stripped-down JDO with a nice GUI builder on top.
Interface Builder has also of course received many well-deserved accolades. However, I think a lot of that acclaim comes from people who have spent a couple hours wiring up a trivial application, written a few simple controllers and said "Gee cool."
Unfortunately, when you try to write non-trivial controllers, things just become painful. I think a fair amount of the pain comes from the XCode IDE, which is very, very 10-years ago. Specifically:
- No refactoring
- No tab completion that is worth using (it's stupid and slow)
- No go to definition
- No 'find all classes that implement Foo'
- Subpar debugger (that I end up having to use far more than I'd like)
I think a lot of these things are just inherently difficult to do in a dynamic language like Objective C. Blame the language or blame the tool, the stuff I've come to rely on just isn't there. I loved CodeWarrior on my PowerMac 6100 back in the 1994, but that doesn't mean I want to use it today.
The tool is really just the tip of the iceberg, though. There is a multitude of painpoints that go beyond tooling:
- No class namespacing mechanism. Ugly prefixes everywhere.
- Manual memory management by reference counting (please).
- Documentation that ranges from excellent to frustratingly incomplete
- 'Informal protocols.' (Apparently, the compiler is actually my enemy).
- General quirkiness in Cocoa: I just spend way too much time googling around to find explanations for bizarre behaviors, only to discover an answer along the lines of "that's just the way it is.
Oh, what could have been if Apple would have just properly supported Java. I understand the momentum from NextStep and all that, but it still sucks that I have to choose between writing a truly native OS X app using nice builder tools on one hand, and using a reasonable and modern programming language on the other.
The oft-heard claim that "Objective C's dynamism is necessary for all of the cool stuff in Cocoa" is baseless - there is no reason the cool stuff could not be done in Java just as well.
Maybe Eclipse or NetBeans will catch up someday. Maybe Swing will continue its trend of sucking less. Maybe we will see Mustang on OS X before 2008. Maybe Sun will actually pull it's head out and enable a truly viral distribution mechanism for the JRE on the desktop.
Maybe, but the historical record is not encouraging.

I think we're just getting older and less patient for nonsense. Solving the same problems but just in a new environment takes the wind out of your sails because unless you see the win in using the new environment it's hard to stay the course and "take the pain" of learning something new. It'll be interesting to see how Sam flames you on this, LOL.