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.

 

2 thoughts on “My XCode 4.x Review

  1. Nice list. You’ve found a number of things that I haven’t spotted yet. Here’s four that I’ve noticed:

    – There is no useful UI-level macro or automation system that allows programmable text manipulation. There’s nothing like Visual Studio’s quick macros and VB, or emacs’s kmacros and elisp, and even the very useful scripts menu from Xcode 3.x is gone. I’ve tried a lot of different things, some more hacky than others, and none of them worked. There’s not even any plugin or extensibility mechanism either, so you can’t even extend Xcode by writing C.

    – As of Xcode 4.2, at any rate – I don’t have Lion, so I can’t run 4.3 – there is no facility for restricting search and replace to the current selection. I’ve been using this facility a lot, in various editors, for various things, for a number of years. It’s kind of amazing that Xcode 4.x doesn’t have it, not only because it’s basic text editing functionality, but also because Xcode 3.x had it.

    – The window layout is really restrictive. emacs and Visual Studio both give you pretty free rein over what goes where. emacs lets you split the frame up how you like, and lets you see any buffer in any window; Visual Studio is a bit restrictive when it comes up to dividing the text editor (in fact, even Xcode 4.x has it beaten in some respects, I think), but it’s pretty flexible about letting you put non-text-editor panels panels wherever you like. Xcode 4.x, bizarrely, isn’t.

    I’d like a full-width find in files view, for example; I’d like my gdb console to have its own window, so it can go on a different screen; I’d like a second text view that I can tear off and put to one side, for reference.

    – Considering Xcode has git support built in, they’re clearly expecting at least some of their customers to use git to manage their source code. But the project snapshot facility also uses git to do its work, and will just bring up error messages if you are using .gitignore files to ignore parts of your source tree. This makes no sense. I doubt there are many people who use git without using .gitignore files.

    *sigh*

    Xcode 4.x has a couple of useful things in it that I’ve found so far (workspaces, and the grid-style project settings view). But I probably find these things useful about… 5% of the time? For my part, I’d far rather the time was spent bringing the text editing experience back to the state it was in with Xcode 3.x.

    Not even like Xcode 3.x was that great a text editor…

    • I like this article Laurent. It’s a nice summary of all the things I run into using XCode 4. Another thing developers migh run into, which you may not run into in smaller apps.
      1) In XCode 3 I have written a game with a large number of assets, and code files. When we used the automatic conversion to XCode 4, we noticed that files went missing, or atleast XCode 4 thought those files were missing.
      2) The indexer in XCode 4 is pretty much stumped when it encounters a binary file format it doesn’t understand, and can sit there spinning a long time.
      3) The pngcrush copy on XCode4 is exceedingly stupid, and doesn’t bother with checking the dates on each file. (I’ve seen it recopy the png files over and over, even if those files have not been touched.)
      4) The indexer will pretty much die if you have PNG files which also have a resource fork, (which many Mac graphic editors still add to your images.)
      5) That 200 line thing is obviously to save Apple’s butt on the list. If you do end up expanding a script’s output which is say 10k lines long. (Something which XCode3 had no problems with.) Then the whole app slows to the speed of a pigeon flying into a 200 mph head wind. It’s so bad, the Kernel decided to crash. All I want is what I had last time, or say an external file with the entire contents, that I can just open.

      One other thing I’ve noticed is that sometimes XCode 4 just spins the cursors, and seems to hang there forever. What I found was that sometimes they just forgot to switch the cursor back, and if you just try using it, it works.

      After meeting the XCode team at Apple last August. I have to say, it’s not a shocker this version of XCode is so bad. The vast majortiy of folks working on it now, are fresh outta college people. Lots of energy, but no experience shipping anything before this. I like this article Laurent. It’s a nice summary of all the things I run into using XCode 4. Another thing developers migh run into, which you may not run into in smaller apps.
      In XCode 3 I have written a game with a large number of assets, and code files. When we used the automatic conversion to XCode 4, we noticed that files went missing, or atleast XCodefe 4 thought those files were missing.

Leave a comment