I love Swift, I hate to use Swift

Lately I've been asked the following question quite a lot "Why are you still using Objective-C?" or "Why you're not using Swift yet?" on Slack channels, Twitter, Podcasts, so I decided to inaugurate my Medium account with a more elaborated answer on why I'm still using Objective-C.

Disclaimer: I'm not here to say what's right or wrong, what should and should not be done, I'm just elaborating on why Swift doesn't work for me, yet.

A Brief Introduction

This is to say that I'm quite confortable with Objective-C, also, that I had my share of hype when new tech was available and faced the consequences of doing so, which now makes me think at least 3x before jumping on the new tech train.

Swift Itself

Scary Updates

Some weeks ago I found some really old projects on my Mac (iOS 4/5), and just for fun I decided to open and try to run. To my surprise, everything worked well. Nasty textures and UI that did not age well but it was up and running. Granted, it's not a super-common use case to get a 6 years old project and run it, but on the other hand, I recently helped a friend that inherited a Swift project that was not updated in ~2 years, besides the project itself not compiling, all dependencies were also outdated, with some of them never seeing the light of a new Swift version support.

But as I wrote before, Swift is getting more and more stable and this will stop being a problem anytime soon, but to this day I still see people on Slack having issues because of Swift versions migrations. Still, if this was the only issue I'd consider Swift on a new project, unfortunately it's not.

Swift Toolkit

Xcode support for Swift is almost laughable, syntax highlight doesn't work, compile times are huge, Swift refactor is missing and most importantly, LLDB just doesn't work.

LLDB is a huge part of my workflow, not just to debug, but to actually write code, automate flows, write logs, etc. I wrote a post (In Portuguese) about some of the things I do with LLDB, and they just don't work in Swift. With Objective-C I have lots of breakpoint actions with debugger commands, sometimes I write entire methods with LLDB expressions and then I do a transcript to actual code when I'm happy with the results, even for some kinds of logs I like to use LLDB + breakpoint actions instead of a NSLog.

Now you are probably thinking "But you can do all that in Swift" and I say "You can't", not because the feature is not there, not because LLDB doesn't exists in Swift, but because they are super buggy. A simple po command runs almost instantly on a Objective-C project, where on Swift it can easily take up to 4 seconds for it to return (on a maxed out 2015 MacBook Pro), and being slow is when it's a lucky day because more often than not, the debugger connection will just be lost and the only way I know of to fix the issue is to restart Xcode and the simulator.

I believe this is the source of a lot of complaints about Xcode in general, I see people complaining that Xcode is buggy, that this and that does not work and I just cannot relate to that, not while I'm using Objective-C.

To Swift or not to Swift?

I really hope that this year the new dev tools will be improved and optimized for Swift, that I can use Xcode without crashing the code completion or syntax highlight, that I can run an expression on LLDB without waiting the equivalent time of a pitch drop. Until then I'll be using Objective-C for everything that I consider "mission critical". I really love Swift as a language, but Swift as a development solution is still not quite my tempo.

iOS Developer, ex-CEO, Apple enthusiast who loves to read/write about life, the universe… and technology

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store