Xcode 8.3

Update: as of 8.3.3 the crashing issue is mercifully fixed, but all the other issues still remain.

Xcode 8.3 is the worst release since I began using Xcode to build apps for my iPhone 3G almost a decade ago.   Every version of Xcode has had its irritants (6 had a lot more than most), but 8.3 is so problematic that I cannot believe it was ever released.  Xcode makes using the excellent Swift language a frustrating, stressful, and unproductive experience.

Xcode has always been a bit flaky, but its reliability drops off a cliff with any project that has a sizeable number of Objective-C and Swift files.  In my personal projects I have few problems with Xcode, because they're all in pure Swift and don't have many dependencies.  But working on a decent sized project with hundreds of classes split between Obj-C and Swift is an utter nightmare.  It's such a shame: Swift is an delight to write in, while using Xcode is frequently a miserable experience.

Here are the things I find I’m dealing with on a daily basis (and not one of them has been fixed in 8.3.1):

The dreadful compile times. 

 

I am literally writing this blog post to give me something to do while Xcode compiles.  My last build took almost 10 minutes.  That wouldn’t be so bad if it restrained itself to full builds when they were needed, but Xcode will decide to do a full build out of nowhere, even when you’ve changed just a single line.  This turnaround time is unacceptably long.  You hit build, you wait for 30 seconds.  You switch to your browser and read an article.  You come back and it’s still building.  You switch back and continue reading.  You eventually remember you were programming something and switch back to Xcode.   You've completely lost your train of thought.  You spend another ten minutes figuring out what you were doing.  Over the course of a day this costs hours and hours of productive time.   

There are tools to highlight exactly what code is taking so long.  All those tools tell me is that, rather than a handful of glaring issues which I can fix and see 10x improvement, my compile times are being drawn out simply because of the sheer amount of lines of Swift that the compiler is glacially churning through - death by a thousand null coalescing operators.  

This is only one item on the list, but it's the worst.   Take the keyboard smashing frustration of this and multiply it by the following:

Crashes on auto-complete.

On opening a new .swift file and entering pretty much anything, there is a decent chance Xcode will decide to crash.  And crash, and crash, and crash.  Once it has decided to do this, nothing will stop it from crashing on that same line after you open it up again and begin typing.  It's so bad sometimes you literally have to write your code behind comments and then uncomment it, or write it in another text editor and copy it across.  This happens all the time, except when it doesn’t.  It’s crashed so many times for me I could have used the crash reporter to write War and Peace to Apple’s software QA team one word at a time, assuming they have such a team.

Autocomplete/suggest not working anyway, despite trying so hard it brings down Xcode.

After crashing, Xcode then does this:

 

No autocomplete for you until this has finished.  And it might not ever finish, at least not on timescales that humans are attuned to.

Type half a class name, and stare at the blinking cursor.  This is your life now.  At the end of your vigil, you might get suggestions, you might not.  You may no longer code at the speed of thought.  It’s like hillwalking with a very slow partner; constantly having to stop and wait for them and wonder if they’ve actually fallen to their death and will never show up.  And then realising that only they knew the way.

Misc.

CMD click on a method - “MyClass.doThatThing()” - and be confused for several seconds after you’re dropped off in “ACompletelyUnrelatedClass.doThatThing()”. 

Typing anything with the Quick Help sidebar open and it’ll refresh itself on every keystroke, interrupting the UI.  It’s what coding over SSH to the moon would feel like.

Failing with no errors:  During build, the red error icon in the status bar will show up.  Then it'll go away.  Then it'll come up again at the end of the build.  You take a look at the Build Time navigation panel.  Nothing.  No error.  You have to build again, and try to catch the error appearing in the navigator during the ten minute compile process.

An app deleted while running will absolutely devastate Xcode.  It will grieve the loss of that process by keeping it running in spirit.  Click the stop menu and it’s ghost is there, unable to be excised.  You must do the only humane thing and also kill Xcode because its attachment is too strong.  You cannot quit Xcode normally and you cannot restart your Mac because even the OS cannot console Xcode.  The only thing is to put a pillow over its face and whisper ‘shhh… it’ll all be ok when 8.4 comes out…I hope”.

I know the tools team at Apple is working really hard to integrate Swift into the Xcode toolchain