Revisiting Xcode

A while ago I gave all new Xcode 2.0 a shot. After some more getting-funky-with-it it’s time to remedy some of what I concluded back then.

First thing is Java development with Xcode. My iBook comes along with 640 MB of RAM. Now I’m a big fan of Eclipse, but it comes with a price. Especially if you have a build that runs different XDoclet templates during a single run. Running Ant took up to 200 MB of RAM with Eclipse demands an additional 200 MB. Well, you do the math. With Tiger, Mac OS X demanded a tiny wee bit more memory, so my iBook ended up swapping the crap out of my disk. With the hard disk not being the fastest, I could get a coffee in the meantime. So I got back to Xcode. As I wrote earlier, it’s not a full blown IDE like Eclipse is. But then, I asked myself, do I need a full blown IDE or the incremental compiler in particular for every piece of code I write? Probably not. I like Eclipse, and I often get back to it, when I build new packages or classes from scratch (since this is not Xcode’s biggest strength).

It took me some time to figure out the best way to set up my project, and I didn’t find it yet, but it was a start. The biggest problem for me was to import the existing project structure either as recursive groups or as a simple folder structure. The former has the advantage that you can remove or add stuff to your liking and that you can open classes directly with a shortcut. Something I haven’t been able to do with an imported folder structure. If someone has any pointers on how to quick-open a source file, I’d appreciate it. The downside with the groups is that new folders from the CVS don’t show up as new groups. If a new folders shows up in CVS, I have to add it by hand which is not how it’s supposed to be. Same goes for new folders created with Eclipse or TextMate. Both have great ways to quick-open files, by the way. In Eclipse it’s Command-Shift-T for classes and Command-Shift-R for any resource. And in TextMate, Command-T is the way to go. It feels a little bit slow sometimes, but it gets the job done.

Apart from the group/folder issues I started to enjoy working with Xcode (yes even in a Java project). The code-sense completion works fairly well. You can’t compare it to Eclipse’s, but it’s good enough for daily work. Navigating isn’t a big problem either. If you point the cursor over a method, you can use Find -> Jump to Definition as a way to jump from method to method. It’s not configured with a shortcut by default, so I used Option-Shift-D. It has some downsides, though, but I can live with them. If you want to jump to the definition of a method that occurs several times in different classes, then you’ll have to select the appropriate one from the drop-down box Xcode will present you. It doesn’t take the context into account, e.g. the type of the object that the message is called on. But other than that, it does a good job.

Another thing I started to dig about Xcode is the SCM integration. Though Eclipse’s CVS integration is not far from being a masterpiece hiding some flaws of CVS, Xcode’s support for SCM stacks up fairly well against it. It’s integrated very well and supports everything you’ll need. Awesome stuff, I gotta say.

There are still some things I miss. Xcode 2.1 started to support code sense only on classes that have an import declared in the current source file. That makes sense in a way, since Eclipse does it the same way. But there is no possibility (to my knowledge at least) to have the imports be organised with a shortcut or have new classes added while you’re code-sensing.

I haven’t tested the Ant integration that much, but it seems to be straight forward. You gotta be careful, though, if your default target (i.e. calling Ant with no arguments) doesn’t actually build your project. Xcode simply calls Ant without any arguments and delegates the building load. Calling custom targets seems to be a problem in the way that you probably can’t clean your active target anymore, since Xcode tells Ant to run the target clean on your build file. These issues are not that disturbing for me, since our projects consists of modules which can be built by themselves, and with the default target. But it would be nice, if the Ant integration could be kicked up some notches in the future.

Although there are still some glitches with Xcode and Java, it’s nice to have the option to work with a not-so-hungry-for-resources IDE when it’s necessary.

Leave a Reply

You must be logged in to post a comment.