Swift compiler errors suck

A lot of the reticence I see for adopting Swift has been less about the language and more about the tools: long compile times, SourceKit constantly crashing, no refactoring, really slow autocomplete, and incomprehensible compiler errors. It’s that last one that’s been annoying the crap out of me lately (forgive my ancient non-Retina display):

CGRect: Extra argument 'width' in call

“Extra argument ‘width’ in call” doesn’t make any sense since init(x: CGFloat, y: CGFloat, width: CGFloat, height: CGFloat) is definitely in CGGeometry.h. The actual problem here is that I renamed index to number and forgot to change it for the y argument. No variable named index exists and it would’ve been nice if the error reflected that.

Still, I don’t regret implementing my first iOS project in Swift. It’s modern, incorporates aspects of functional programming, and is generally fun to code in. I’m reasonably confident many of the tools issues will be resolved as the language matures.

Leave a Reply

Your email address will not be published. Required fields are marked *