Swift Versus Objective-C
A topic that the Internet has discussed to death, but here’s my take on it:
What’s the better language?
Swift.
The core library is far saner and the language is far more consistent as it doesn’t have the requirement of being a superset of C. Fans of static types will also love the Swift type system.
Which one should I use if I can choose either one for a new project?
Swift.
There are some APIs that aren’t quite up to speed just yet, like Metal. But, generally speaking, it’s a better idea to use Swift and simply write bridge code if you need to pull in Objective-C libraries.
It’s 2020. Which Should I learn first?
Swift.
There’s some Objective-C code still around, but the Swift ecosystem is vibrant and dominant. Nobody learns Objective-C if they can help it.
It’s 2015. Which one should I learn first if I’m looking for a job as an iOS developer?
Objective-C. Don’t worry – you don’t have to spend the rest of your career in Objective-C. And you don’t have to become a grandmaster. But, just like it’s helpful to learn assembly to understand C, C to understand Java, and Java to understand Clojure, Objective-C will help your general understanding of iOS and give you a better foundation for when you’re ready to move to Swift.
There’s a case to be made for simply learning Swift first and then learning Objective-C later, but I find that too much of iOS development is working with legacy codebases and third-party libraries. So, without a working knowledge of Objective-C, you may find it difficult to be productive working on real-world applications.
If you’re an accomplished programmer with experience in other languages, you may want to learn Swift first and only learn Objective-C when you bump into it. However, if you’re a beginner and hoping to gain a deep understanding of iOS, I recommend you learn Objective-C first.
Honestly, though, it’s essentially a question of bottom-up versus top-down learning. If you like to learn the practical, nice stuff first, learn Swift. If you want to learn about the primordial ooze that iOS has been built upon, learn Objective-C.
I advocate learning Objective-C first, but we’ll soon hit an inflection point where Swift support is truly first class, more code is in Swift, and the arguments for Objective-C are fewer and fewer. Ping me in a year and we’ll see if my argument still holds.
David Kay has realized that The Matrix was indeed a documentary. Let's awaken together. If you found this article helpful, join his newsletter.