According to Hoyle...

Looking Forward to Mac OS X 10.5 Leopard, Part II: Xcode 3.0 IDE

September 2007

by Jonathan Hoyle

jonhoyle@mac.com

macCompanion

http://www.jonhoyle.com


Last month, we reviewed Apple's latest operating system, Mac OS X 10.5 Leopard, from an end user's perspective. We now continue looking at Leopard but from a developer's point of view; in particular, we will review Apple's latest update to their developer tools: Xcode 3.0.


Legalese-y Does It

As a reminder, Mac OS X 10.5 Leopard is pre-release software and is are covered under a non-disclosure agreement. This means that, prior to its release (due sometime next month), I am not allowed to discuss all of the features that I would like to. I am allowed, however, to discuss any features which Apple has already disclosed to the public, or are otherwise already in the public domain. Fortunately, Apple has documented a great deal about Xcode 3 since the latest Worldwide Developer Conference, and I am sure you will be as excited as I am to see these great new features. [For more detailed documentation from Apple, visit: Apple's Xcode page and Apple's Developer Tools page.

The Apple website also makes the following note about these features: These Leopard overview articles show features and interface elements that are pre-release and may change. This is important, since Apple has been receiving continual feedback with each beta release of Leopard. With only about one month to go, however, I would assume that any changes will be small ones, at this point.


Great Leadership

Much has been written about Chris Espinosa's early days at Apple (he was Employee #8) and the valiant work he did as part of the original Macintosh team. However, I think his best contribution is coming now as Manager of the Xcode IDE Core team. Under his leadership, Xcode is finally becoming a top-flight development tool, worthy of Apple's reputation.

As many of you are already aware, Xcode 1.0 was introduced in 2003 and was little more than an update to the creaky ProjectBuilder developer tool used back in the NeXTStep days. Most Macintosh developers were still using Metrowerks CodeWarrior at the time, and Xcode was an interest only to the student and small smattering of NeXT-turned-Cocoa developers. All that changed in 2005 with Apple's decision to migrate the Macintosh platform onto the Intel processor. Just weeks earlier, Metrowerks CEO David Perkins made the self-destructive decision to sell off its Intel-based tools, despite cries from the developer community of what that could mean. In short order, Perkins killed his own customer base, and Mac developers went scrambling to learn Xcode.

By this point in time, Xcode was at version 2 (the first truly usable version of the product). Cocoa developers had been using Xcode all along and saw only improvements as Xcode evolved. Carbon C++ developers, however, had a much more difficult transition moving from CodeWarrior to Xcode. Xcode's slower performance and numerous quirks was a difficult adjustment for many. To this day, many Carbon developers still long for CodeWarrior's combination of ease of use and development power. I am pleased to say, however, that Xcode 3.0 is in fact a superior product to any release of CodeWarrior. And much of this is due to Espinosa's clear-headed direction and understanding of the developer's needs.


Civility at last

Unlike most other Mac OS X applications, Xcode hasn't always been a very good citizen. Xcode was required to reside in the Developer folder on your boot volume and could not be moved without risking disaster. Worse still, the version of the product was tied to the operating system: Version 1.x would run only on Panther whilst 2.x would run only on Tiger, each with their own project file types. If you had a bug in a different operating system than the one you were developing in, you had to convert your project to the other type just to debug into it. Yechh.

With Xcode 3, all that changes. The Xcode 3 folder is self-contained and can be moved wherever you wish, including a removable hard drive. Furthermore, Xcode 3 plays better with others, allowing you to have multiple versions of Xcode on your hard drive. Thus you can have an Xcode 2.5 (which runs on both Tiger & leopard) folder, Xcode 3.0 folder and some later Xcode 3.1 folder all on your hard drive. To facilitate cross-development, Xcode 3 is interoperable with Xcode 2.4+, meaning that the file types are compatible. Only when you add Xcode 3.0-specific behavior to your project does the file type get modified, and you are warned with an Upgrade or Cancel dialog.

A command line version of the Xcode Editor, called xed, is also now available with Leopard, along with the powerful Xcode Organizer.


Editor Improvements

The Xcode editor has been sufficiently enhanced to finally be up to 21st century standards. Those familiar with Microsoft Visual Studio will be glad to see the inclusion of Code Folding: the ability to collapse logical blocks of code so as to be able to concentrate on the code that is important to you:


Another really nice feature by Apple is Code Focus. When turned on, this feature gives visual feedback to the nesting level of your edit selection. Alternatively, you can leave it on all the time to get a handle of the structure of your code:


Code Completion has been enhanced by allowing an immediate option: rather than hit the Escape key to see your choices, you can it run live an auto-fill as you go, as per REALbasic or Visual Studio. Other changes include performance improvements, additional syntax coloring, an Xcode News pane, Project Find being integrated with Spotlight and documentation nicely integrated into the IDE.


Goodbye, Debug-Mode!

One of Xcode's best features is Seamless Debugging. Even back in the CodeWarrior days, Mac users have had to deal with mode-based development: Edit-Mode, Run-Mode and Debug-Mode. Your code gets duplicated in three places: the Edit window, the Debugger window and the Error window. With Seamless Debugging, all this is in the past. You edit, put breakpoints, and see error messages all in the same edit window. Very nice.

As for your errors and warnings, Message Bubbles appear in the editor so that you can see what the problem is:


In addition to the usual errors and warnings, Apple can now display a Message Bubble for deprecated function calls, making it vastly easier to see where your code's greatest weakness and potential problems lay.

Expression evaluation is facilitated with Xcode 3.0's Data Tips, allowing you to hover over a variable to view its value:


Xcode 3 has also added support some ANSI C++ types, such as std::string and std::vector<>, but not general STL containers. I am hoping that future updates to Xcode will generalize this useful feature.

Another extremely nice feature is Xcode 3's Mini-Debugger: a debugger living in a floating window, so as not to upset the event stream. This is extremely useful for those debugging full screen applications, or debugging into mouse/key events.


Habla usted Ruby?

The primary users of Xcode are C++ and Objective C developers. However, Apple is truly embracing some of the newer 4GL languages and adding support for them in Xcode. Two languages which are particularly hot right now at Apple are Ruby and Python. As these languages mature, I expect to see them receive first class citizen support in the not too distant future.

Although Xcode 3 continues support for Java, there does not appear to be a great deal of interest in this arena. Java developers are probably best served moving to a different environment, such as the excellent IntellijIDEA by JetBrains, or for those on a budget, the freeware Eclipse.


Coming Up: We continue our look at development with Mac OS X 10.5 Leopard by examining changes in Objective-C 2.0. See you in 30!

 

<< Previous Article

Article List

Next Article >>