oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

Ten Things I Dig About Xcode

by James Duncan Davidson, author of the upcoming Running Mac OS X Panther

Following in the footsteps of the Ten Things I Dig About Panther article that was published on October 10, and to celebrate the public release of Mac OS X today, I've decided to focus in on the eleventh item from that list, the revamped IDE, called Xcode. There's a lot to like about Xcode, and the rest of the toolset now known as the Xcode Tools.

As with the last article about Panther, this is by no means an exhaustive feature-based review. To be honest, it's going to take a bit of time to pull together a really good review of the new Xcode IDE and to explore all of its capabilities. But, in the short amount of time that I've played with Xcode so far, these are the things that I've found myself really digging about it.

1. New User Interface: The first and most obvious thing you'll notice about the new Xcode IDE is that the Project Builder interface of old has been totally replaced with a new and much more polished UI. The old Project Builder interface was functional--good enough for day-to-day work, but evidently was not something that Apple was happy with. So they brought in their UI experts--the same ones that worked on the new Finder and iTunes--and rethought how the IDE should go together. The result is something that just plain feels a lot more polished and honed.

2. Smart Lists: The new UI is more than just window dressing. The Xcode team is out to make sure that you can drill down to just the code that you want to focus on. Think about how Smart Playlists work in iTunes. Now, apply that to an IDE and you have an idea of how these lists work. For example, if you click on a target in Xcode, you'll just see the files related to that target. It's a small thing conceptually, but in large projects with lots of targets, it's quite handy to drill down to just the code that you are interested in at the moment.

3. Symbol Browsing: So far, my favorite mode of working with code in Xcode isn't a bullet-point item on Apple's web site, but it should be. It's the Project Symbols view--instead of navigating your project file by file, it allows you to take a look across all the symbols in your project--the classes, methods, functions, and variables that make up your application. In the short time that I've been playing with Xcode, I've used this feature more than any other to navigate through the source code in my projects.

4. Fast Search: Just like iTunes, the Xcode IDE sports a quick-find box in the toolbar that allows you to drill through the items in the main list. Combined with the smart lists, this will let you find anything you are looking for in a snap.

5. Build Error Notification: Instead of slapping a big ol' build window across your screen, Xcode now shows you the errors and warnings in your code in a much more elegant way. First, all the compilation errors and warnings are gathered together in the aptly named Errors and Warnings smart list.

Second, the errors and warnings are flagged with icons in the gutter of the text editor. This indicates quickly what line an error is on while letting you just work with the code, without a lot of clutter in the way. Very elegant and nice.

6. Three Pane/One Window Use: Even though by default Xcode opens source code in separate editor window, you can activate the one feature I really liked about Project Builder: The ability to have a single window for navigating and editing your code. To enable this, simply hit the three-pane icon in the toolbar.

7. Documentation Viewer: Lucky seven and one of the best. Again, this isn't a feature that's been pushed on the Apple web site before the release of Panther, but it's one that I think is the biggest help of all--the ability to quickly and easily go through the Apple developer documentation. The documentation viewer sports a quick-find box in its toolbar (like Finder and iTunes and Mail and... you get the point) and it lets you blaze through the documentation in a flash. Before this feature I was a regular user of both Cocoa Browser and AppKiDo. Now, I find myself using the built-in documentation viewer all the time and prefer it over either of those two tools that I used to rely on so much. Both Cocoa Browser and AppKiDo have features that aren't in the Xcode documentation viewer, but the single ability to quick search through the documentation makes those features less critical to have.

8. Code Completion: Finally this useful, and long overdue, feature comes to the Apple developer tool suite. I've always been a fan of being able to save keystrokes, and the code-completion features in Xcode promise to help shave off a bit of time--as well as repeated trips to documentation to remember how to spell a particular method. There are a few key sequences you can use to activate code completion: Hit Control-. (period); Option-Escape; or F5 (or fn-F5 if you are on a PowerBook). These keystrokes will pop up a window from which you can pick the appropriate item. You can also turn on code completion full-time in the Navigation section of the Xcode Preferences. I'm sure that this will cause a slight performance hit on slower machines, but it seems to perform well on my PowerBook.

9. Predictive Compilation: I'm a big fan of letting the machine do as much work as possible in the background while I'm thinking about other things. Instead of making me wait on a compile, predictive compilation promises to speed up the process quite a bit. Instead of waiting for you to hit the build button, Xcode will go ahead and compile changes in the background--and then commit them to disk when you hit the build button. I haven't had the chance to exercise this feature with a large project, but so far, it seems to work as advertised.

10. Revamped /Developer/Applications Directory Organization: The /Developer/Applications directory was getting a bit crowded. In Jaguar with the developer tools, it was always a crapshoot whether you'd have to scroll in column view to find the Project Builder icon. Apple must have realized that 90 percent of the time, when you go to that directory, you want to launch Xcode, so they cleaned it up and moved the various accessory tools to their own subdirectories. Now just Xcode and Interface Builder applications appear in this directory.

Just like with the Panther article, it's too hard to limit myself to just ten items. So, here's one more...

11. Rendezvous-Enabled Distributed Builds: This one is probably the excuse that I'll use to go ahead and buy that dual G5 machine I've been lusting over. At MacHack this year (which was the weekend before WWDC), there were a few of us gathered around talking about our hacks. One guy had the idea of doing distributed compilation with Rendezvous. He didn't finish his hack, but just a few days later we saw the same idea demonstrated at WWDC in a demo of the axiom that great ideas show up in more than one place at once. It's nice to see Rendezvous being used for more than just chatting and music sharing (much as I use those two features all of the time). I foresee lots of interesting things in the future when it comes to Rendezvous and Xcode.


Mac OS X 10.3, widely known as Panther, is available from the Apple Store. Apple includes the developer tools with the operating system, so you can start working with Xcode right away.

There are so many other cool features that I could talk about here. Zero Link and Fix and Continue come to mind. But so far, these are the ten, 'er eleven, things that I've really been enjoying about using Xcode. It definitely represents a major shift in Apple's IDE and I think it will take people a little while to get used to this new tool. It's also different enough than Project Builder and other IDEs that it's going to take a few months to really start getting the hang of how to best utilize it, but there's some serious potential here and I'm really happy to see Apple investing the same kind of attention into the IDE that it put into iTunes, iChat, and the rest of the applications that ship with Mac OS X.

Of course, as great as the new Xcode is--and how far things have progressed since the last release of the developer tools--there is always more that could be done. There are many things that I would like to see in future versions. Here are a few of them:

  • The ability to build a distribution build directly into a package without having to use Package Maker externally. It should just be a one-click build command from within the IDE to make a complete, ready-to-ship binary.

  • The ability to define subprojects or declare dependencies on other projects. Sure, you can structure targets together for quite a bit of flexibility, but there are several bits and pieces of code that I reuse among many of my projects and I'd like to just declare a dependency on that project instead of either creating a target separately in each project or importing the code.

  • The ability to integrate unit testing tools into Xcode. Agile programming is all the rage these days--and for good reason. Test-first development has changed the way I create code. Currently, the existing tools have had a limited amount of integration with Project Builder. What I'd like to see is the ability to design unit tests alongside the code, and have the test errors show up in the "Errors and Warnings" list as well as in the editor gutters. There are a few ways this could be done, but Apple is probably going to have to expose a bit of functionality for the tools to plug in nicely.

However, I'm willing to wait a little bit for these features to hopefully come to the toolset. This release of Xcode is a welcome improvement and a big thumbs up goes out to the Apple Xcode team for all the hard work they've put into it.

James Duncan Davidson is a freelance author, software developer, and consultant focusing on Mac OS X, Java, XML, and open source technologies. He currently resides in San Francisco, California.

Return to the Mac DevCenter