Looking for a freelance iOS/Mac developer? Get in touch!

Do I Need to Switch to Swift Now?

posted on 16th Jul 2015

If you're at all familiar with Betteridge's law you'll know the answer to the title of this post already, but I want to discuss the reasoning why. Ever since Swift came out I've seen a lot of people who've jumped on the bandwagon proclaim that Objective-C is dead and anyone who isn't already investing in Swift is stuck in the past and will be left far behind. I've even seen some people proclaiming the past few days that developers who aren't using Swift now aren't worth hiring. Needless to say I think this is bullshit.

Objective-C Isn't Going Away

Objective-C is still an incredibly powerful and flexible language, Swift hasn't taken that away. If anything Swift has prompted Apple to improve Objective-C further. It also represents the vast majority of code that exists for the Mac and iOS, with more being added to that daily. If you're working on any existing project, especially a large pre-existing one, Objective-C knowledge is still going to be essential for a very long time.

Even if you only write Swift, you're inherently dependant on Objective-C. Your app is running on the Obj-C runtime, using frameworks written in Obj-C and built using an IDE written in Obj-C. Apple can no more scrap Obj-C in the near future any more than they could scrap C or C++. If they ever do remove it and/or cease to support it, it will require 10-20 years to do correctly, unless they choose to completely re-write components, but we know how that can go.

Swift Isn't Ready Yet

Yes you can write code in it. Yes you can even submit to the App Store. Neither of those make Swift objectively ready. I can write Objective-C code today and be sure it will still compile with a version of Xcode in the future. The same is not yet true for Swift. It is an alpha-quality language with alpha-quality tools. It is still changing at a rapid pace, which is good for it to improve, but bad for anyone who wants to learn it as they have to relearn how to use it every few months.

Swift is also immature on a higher level too. It is a very different language to Objective-C so one cannot simply use the patterns and best practices built up over the past 3 decades. Even if the language wasn't continually changing and improving, it would take a while for the patterns and best practices for Swift to emerge. They come out of code being written, and even with the spectacular start Swift has had, there simply hasn't been enough code written by enough people. We're starting to see some of these emerge and the language start to embrace some of them, but this area will see rapid changes for many years to come.

For you, these may not be big problems and so you may consider Swift ready for your circumstances and needs. But considering something not to be a big problem for oneself does not make that something not a problem, nor prevent it being a big one for someone else.

You Don't Need To Be There From Day 1

There are some advantages to using something from Day 1. You have more experience and know all the little quirks better. But anyone who has worked in this industry for any length of time knows that experience is not accurately measured in number of years. If you already know how to program then becoming an expert in another language is relatively simple. And even experts don't know everything. I've been writing Objective-C for over 10 years now and I'm still learning new things both from those who've used it longer and those who are new to the language.

It's worth remembering just how young Swift is. It's only just over a year old. I wasn't even born when Objective-C was that old. Objective-C was already 20 years old when I started learning it. Java and C# were about 10 years old when I learned them. Ruby was about 15 years old when I learned that (and was ~10 years old when Rails was created). I haven't been hurt by not being the first on those languages. My career hasn't suffered because I didn't jump on right away. Nor will it for anyone not jumping on Swift now.

I've been through the "jump on the next new thing" phase of my career. I did that with Auto Layout and spent a lot of time working around issues and complexities in its early releases. I did that with Garbage Collection, which is now due to be removed in Mac OS X 10.12. There are those who jumped on Java-Cocoa, which was scrapped years ago. Fundamental technologies like LLVM, or even OS X, have been released early but not fully usable until several versions later.

New technologies come out all the time. Most stick around, some don't, but all of them take many years to become mature. You can choose to jump on in those early years, but any experience you gain from using them early is offset by the extra work you need to put in by being first. That's a difficult enough decision to make for an API, it's an order of magnitude more difficult a decision when switching language.

Don't Feel You Need To Rush

If you have the time, energy and resources to put into learning Swift now, then by all means go for it. It's an interesting and ever changing area. But don't feel you have to be pressured into it by those trying to justify their decision to jump in early by shitting on those opting to wait. This isn't something that was released 10 years ago that people are still refusing to even acknowledge. This is a very new language and will be for a few more years yet. We're a long way off it being essential to know Swift well, let alone needing to use it as your primary language. Sometimes waiting and watching can be the smarter path for one to take.

If you would like to send me a comment on this post, send an email to pilky@mcubedsw.com. Alternatively send a tweet to @pilky.