My XCode 4.x Review

Here is an attempt at trying to enumerate the things I experienced using XCode 4 while developing an iOS application.

As you will read from my comment below, what came out of my experience dealing with XCode are lots of annoyances and major issues. The long due redesign of Interface Builder by now, didn’t bring so much value to the table. Having two processes communicating for building one app was not so painful. At least, when one was crashing the other one was still running. Now everything goes down in flame and more often than I wished. Kaboum!

In general, XCode 4 feels extremelly sluggish even on a MPB with 8GB of RAM. I’ve been putting my XCode 4 upgrade on hold for some time after reading so much bad press about it from sites like Chromium Project, as late as last December. I finally upgraded because I needed to code against the latest iOS SDK. I thought that waiting for a dot release would resolve an early adoption syndrom (never trust a dot zero release). Nope, that didn’t work with XCode. Even Project Builder on NextStep 486 felt faster in comparison. Performance in XCode 4 is abysmal. You are not going to get any speeding tickets using XCode 4. On the contrary: lots of coffee breaks while the app is doing “something”. I’m tempting to ask for Apple to run their own performence tools (Shark) and figure out where are these bottlenecks are in XCode then fix them please.

More regarding performance: I get the spinning cursor more too often than not. Sometimes it happens when I did a user “mistake”. Try selecting all your files when the focus is on the project navigator instead of the file opened (the cursor is not in the document.) You’ll curse when you see the result. I believe the code is literaly going through its XML project files parsing away with no interruption possible whatsoever. Keep waiting, because it will eventually get back to you. This is not right.

Indexing is in the way. while XCode is re-indexing constantly, which is fine by me, sometimes it’s locking up the UI after a build, which now becomes a problem. It’s as bad as “Emptying the trash” message in Finder. And I thought that only iTunes runs on a single thread. Here you want to say: “Who cares!?!” if it’s indexing, just do it and leave me alone. Can I resume typing code now, please?

What indexing is good for? Auto-complete for one. So how does AC measures up? Not very well, I am afraid to say. Jumping to definitions in C++ is going to bring you the whole list of functions in every possible files that exists on your system. No wonder it takes forever to index. And this is happening while you are clicking on a namespaced function!!! WTF Apple! I hate to bring it up, but have a look at how it’s done in Visual Studio to see a useful example of selective navigation thru symbols.

The dreaded alert message: “XCode has encountered an error, do you want to continue or select crash”. Nice! While my files are opened and unsaved for a while now… @#$% What should I do? This message appears more often than than I wished it did, about 2 or 3 times a day. What other choices do I am than to click continue really? Am I crazy enough to click the crash option? I don’t consider my application such an heavy development to realize that Apple can’t be using XCode 4 internally for their own development. If they did, they would fix this type of problems, don’t you think?

This brings me to the next point: XCode is not another MacOS X application. For one, it doesn’t follow the automatic updates mechanism. It means that even with the tons of crash reports Apple is getting, don’t expect to see any bug fix updates frequently. I can tell that XCode may even be internally not subject to the same quality level as users applications. It seems that if Apple staff were using XCode, most of these problems would be fixed by now.

One thing you do when you develop an iOS application or at least try to do, is build a modular application with re-usable pieces. Apple calls these “Frameworks”. That is a great concept. Bundle the libs and headers in one package and drag them around to your next project. Except that you can’t build a Framework that works on iOS and the Mac Simulator (it’s called universal) because Apple removed that option from XCode 4. I use a script from StackOverflow, but frankly I am perplexed at to why would Apple remove such a convenient feature on purpose.

The addition of Frameworks and libraries went some place under “Build Phases”. Just measuring the hit score for that given hint on StackOverflow makes me realize how clunky the location for that functionality has been thought out. I struggle with XCode. Sometimes, the project will open (after one of those crashes), and no project navigation or toolbar. I need to go and reselect those.

And when you finally found that option Apple keeps moving around such as “adding libraries” you have to type in an auto-complete dialog the name of your libraries that you have to select one by one. Ugh! Did I mention that folders with libraries inside don’t automatically open when you type their names? Click, click, click…

GDB visual interface is far from being useful. I’ve tried using it to inspect arrays and other objects. I have to constantly go back to the cli on the right side. We are miles away from Intellij IDEA ease of use their great debugging UX.

When you start to enable and disable too many breakpoints, the app gets confused. It suddenly won’t let you put a breakpoint on a line. You need to delete them all and then you are able to add a breakpoint.

Analyzing compile error using error logs is an exercise in mouse click practice. The most recent error log won’t pop up. Instead you often need to access it thru the right-most icon then click on the top entry in the list. Why?

Analyzing the linker logs. All entries are truncated at 200 lines, so you end up clicking (again) or expanded dialogs to see the full logs. It’s there all right, not just conveniently accessible.

Using most recent files: Suddenly the tabs are gone and you are left with two arrows to navigate thru hundred of files. What gives? The most recent file list is burried in a sub level in that icon line.

The debugging process suffers from the most-recently used page cache eviction bug. The OS will keep paging out the latest app you compile even if you want it to go away since you are recompiling a fresh new one.

The other debugging short-coming are intropection of variable on the source document. The hilighting of info on parts of the code deosn’t reveal any content value. Again, you are forced back to using ‘p’ and ‘po’ in gdb cli.

Debugging multi-threaded app causes crashes at a worrisome rate. I ended up implementing thread disabled code to be able to debug it.

And whatever you do, don’t rename or remove files and projects OUTSIDE XCode unless you are ready to work from the lastest backup.

On a side note: my recommendation is to stay away from snapshots since they lock you down in XCode while replicating functionalities you should get from a a good versioning system like svn or github. Plus, it will take another few hours of uninterrupted work for XCode to snapshot your project. Why this can be done in the background if you have to absolutely use this is beyond me. Once more, I seriously doubt that Apple is using their own “dog” food here.

In conclusion, XCode is a development tool that should be designed exclusively to boost developer productivity on a platform that Apple claims greatly simplifies development.. In order to achieve this sound goal, I suggest for Apple to fix the major bugs and start giving its developers community some love, by offering a tool everyone enjoys using on a daily bases.