Sunday, November 04, 2007

A brief review of XCode 3

Spent much of Saturday getting in to XCode 3 which ships with Leopard. My project was to build a Cocoa native version of the AppleScript Studio app I built last week to read and ultimately control a Yaesu FT-817 radio via a serial interface.

Having used Microsoft's developer studio, Borland's C++ Builder and the beloved Metrowerks CodeWarrior, the old XCode seemed like a step backwards in programmer friendliness.

XCode 3 is a major step forward. 

It's taking me a little while to stop fighting it and go with the new work flow. Here's my observations:
  • You don't really need to go to the debugger window, variables are now inspected by rolling over them. The open up so you can inspect structures within objects very nicely.
  • The output console doesn't open automatically and until I found it I used the system-wide console to view my NSLog() printouts. 
  • Interface builder has been completely re-written and the vast array of available NIB objects are available in an easily searchable window.
  • I'm having a bit of trouble with the synchronizing between my XCode project and Interface Builder, I end up putting declarations in my .h file and dragging it to IB each time.
  • There's a handy link at the bottom of the IB window to take you to the XCode project.
  • When there are build errors they appear in red balloons right in between lines of your code. At first I found this a bit annoying but now I think it's pretty clever.
  • Code focus is where you put the mouse in a little left margin and blocks of code are highlighted - it's a bit alarming when you first do this by accident but now I think it's neat.
Still to try out
  • Cocoa 2 with garbage collection and automatic synthesis of getters and setters.
  • Project versioning - although I'm loving having Time Machine taking care of me all by itself (tip, watch the console for a while and see all the clever things it's doing)
Cocoa compared to AppleScript

It took me a lot longer to get this going in Cocoa compared to AppleScript mostly because I had to figure out how to drive the serial port. In AppleScript I found an extension that did it all for me, in Cocoa I found some classes from Andreas Mayer and others that are fantastic.

In AppleScript I used the idle handler, in Cocoa I had to use NSTimer.

I'm really enjoying Cocoa now that I'm up and running. It feels really solid and my only complaint is the sheer richness of the library, it's getting really huge and when you can't remember the method name you have to hunt through a huge list. It would be great if code completion could first show the most commonly used methods rather than the whole list.

We desperately need a new edition of Hillegass.

1 comment:

Anonymous said...

That's actually one of the problems I'm running into myself. I am a newcomer to Mac OS X development and I've found it rather difficult to have all of these books and references for the old workflows. It's far too easy to get lost and confused, and in the end, frustrated. I eagerly anticipate manual exploration as well as refreshed books on the subject. Leopard brings too much to the table.