Xcode is the Worst Piece of Professional Software I Have Ever Used
The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
This is an error you will see often if you develop SwiftUI in Xcode. Know what it means? It means the compiler has given up, and you're on your own. The error points to a file and function, but the issue could be anywhere in your codebase. It might be a simple syntax error, or it might be code that is "too complex" for the compiler. Hopefully you commit frequently because Xcode has turned into Notepad until you figure it out.
Speaking of git; consider the project file (myProject.xcodeproj/project.pbxproj
).
This file contains all of your project settings, build configs, file references,
signing configs, and anything else you can think of.
If there are any errors in it, your project simply won't open.
It is thousands of lines long and not human readable.
Here's a small sample:
7A226CEB2D722B3C001539F8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7A226C922D722973001539F8 /* Pods.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = E826FA0DCB9AA6E7829C68391B323B78;
remoteInfo = "GTMSessionFetcher-GTMSessionFetcher_Core_Privacy";
};
I won't explain what that means, because I don't know what it means. A merge conflict is exactly as miserable as it sounds. The semi-sane way to deal with it is to use something like xcodegen to rewrite the project settings in a normal-ass file type like yaml and then use that to generate the Xcode project files. BTW the entire UI layer for UIKit apps is stored in unreadable files like this. Imagine.
Take a look at this dialog box.
Notice that weirdly dark drop shadow behind it?
That's not a UI glitch; that's
<positive finite integer>
dialog boxes stacked on top of each other,
each waiting for your admin password.
You'll know you're close to done when the drop shadow starts to lighten.
Software has bugs and design flaws.
I'm not trying to say Xcode sucks because it's buggy
(although I'd like to emphasise that it is very buggy).
It sucks because it pretends it isn't.
Look back at that first error: unable to type-check this expression in reasonable time; try breaking up the expression
It's not a bug, it didn't crash, it just... you know. Taking a while.
Try wasting your time refactoring your code
without knowing where the problem is or having the help of a compiler.
Suppose you're testing out in-app purchases (God help you). You follow Apple's docs, create a sandbox account for testing, and then open the simulator. Apple says the sandbox account will appear in the phone settings after running the app, but of course it doesn't. You attempt to manually sign in and see this:
Okay probably a mistyped password. Try again.
Try 10 more times.
Maybe you shouldn't have skipped the 2FA setup for this test account?
You set up 2FA.
Still nothing.
You open the Xcode debugger and find
Password reuse not available for account. The account state does not support password reuse
.
WTF is this? You're not reusing a password.
You start to wonder if maybe this doesn't work in the simulator,
even though Apple's docs make no mention of this.
You search around on the developer forums.
People confirm that this definitely does not work in the simulator.
Other people confirm that it definitely does.
There's no answers to be found, and no solid info anywhere.
As a developer, you learn that you simply cannot trust Apple. There is a persistent layer of vagueness and misdirection around every part of the experience. All those WWDC videos showing off new features and frameworks? You know, the ones where the presenter is seemingly going to be shot if they don't hit the adjective quota? Those are basically ads. Watching a presentation on the SwiftUI preview feature (a way to see your UI update without a full app rebuild. Not to be confused with the actually useful hot reloading in Flutter or a web based framework) and then trying to actually use it was pure comedy. There's been years of steady improvement and last I checked it was still mostly useless for any sufficiently complex project. So imagine how bad it was at launch. Not a hint of this at WWDC though. Just a seemingly complete, cutting edge new feature that Apple is so excited to tell you about.
Here's the kicker. Something I cannot and will not get over. Apple's bug tracker is private. You can submit a bug (which has been euphemized to "radar"), but the bug reporter is a black hole; information goes in but it doesn't come out. Starting to wonder if some weird behavior with navigation is maybe not actually a problem on your end? Expecting to search through some Github issues-like tracker to see if anyone is experiencing something similar? Sorry. Better that thousands of developers waste their time rediscovering some subtle framework bug than for Apple to publicly acknowledge a flaw.
It isn't just opaque issues and errors. The design of Xcode and everything around it is stifling. There are currently no real alternative editors if you're working on an iOS project and want things like linting and code completion (it is actually possible with neovim using xcode-build-server, but it's pretty flaky). Jetbrains' AppCode was killed off a few years ago. CLI tools are poorly documented and difficult to use, which means simply trying to script basic things or do CI is painful. Fastlane helps, but it's ridiculous that there needs to be a big Google-funded open source project to just make scripting tolerable. This means Claude Code will struggle to do anything useful too BTW (even more than it already does). And of course it goes without saying that you must be doing all of this on a mac in the first place.
I actually learned software development in Xcode, back before automatic reference counting was even a twinkle in Objective-C's eye. I honestly believe that it hurt my growth as a developer and gave me a poor set of instincts. Rather than reacting to a problem by seeking to go deeper and understand what is happening underneath the code I'm writing, the solutions were mindless and ritualistic. "Try restarting Xcode. Try clearing the derived data. Try rebooting your mac. Try the Xcode beta branch. Try recreating the project." Of course I could have been more mindful and deliberate, but it's hard to know what bad thought patterns you're picking up when the environment is working against you.
I wish the developer experience was better, but Apple does not appear to want to address their technical debt, and developers were always second class citizens anyway. I would encourage any new developers to try and stay away from Xcode (to the extent that you can), and if you are using it and questioning your own sanity thinking "am I just holding it wrong?": no, you're not. Xcode sucks.