You will still need to know Objective-C, despite the introduction of Swift

I read online some remarks of people claiming that the introduction of the new Swift programming language is going to remove all the barriers to entry for iOS development. Some even think that Swift is going to put every developer back at square one. I understand the excitement around a new language after 20 years of Objective-C. Although these claims might have some merits in the long term, they are at the moment not only inaccurate but completely opposite of reality.

We can all agree that Swift is a big step forward in regards of iOS development and it’s going to have a big impact on how we make iOS apps. It is definitely a more modern language than Objective-C and fills the gaps left open by its ancestor. It is also true that Swift has a syntax that will be simpler for many and which might be easier for beginners to pick up. It is definitely a syntax closer to that of many other modern languages than the Objective-C one. Moreover, Swift introduces many concept that already existed elsewhere for quite some time. This will make it easier for developers coming from other languages and platforms to find familiar constructs in the language.

But this is where it stops. Those who think that the only problem in learning iOS development were its square brackets or its uncommon syntax are completely missing the point. If anything, this is a small and momentary barrier that you can quickly overcome. Objective-C is not a weird language that does not make any sense, quite the contrary. Once you get familiar with it, the Objective-C syntax makes sense to many and has its own merits regarding its readability. This can be easily seen, since Apple decided to keep some of Objective-C’s peculiarities in the Swift’s syntax.

But this barrier of an uncommon syntax is definitely not the only existing one, nor it is the hardest to overcome. iOS is a whole platform. It has its own paradigms, design patterns, and a huge amount of libraries that a beginner cannot learn in a few days. In this regard, Swift is not going to make any difference. After acquiring familiarity with the language, be it the old one or the new one, a new developer still does not know many things about iOS. For example, what a view controller is and what is its role in an iOS app, or how the MVC and Target-Action patterns are used in iOS. And this is just to start with the basics of the platform.

The iOS library has grown over the years, and includes many useful framework that make a lot of tasks much easier than in the past. But anyone new to the platform needs to learn these frameworks to make iOS apps. There is a huge difference between an experienced iOS developer and a beginner. This is even more true for someone who never programmed before. I, for example, can get the Swift manual released by Apple, read it in one go and start writing apps in a week. Yes, I will be a bit slow at first. At times I will pause to think how to do something in a language I’m still not familiar with. But I will pick it up quickly while working on a real project, because I know how iOS works, and that has not changed.

Objective-C is a tool in the developer’s toolbox.
Changing it with another, newer, shinier tool will not magically bestow knowledge over a whole platform.

Let’s get to another misconception I have read: Objective-C is not going away any time soon.
When Swift will finally come out of beta (as I write this it has not yet reached the 1.0 release), it will not all of a sudden replace Objective-C. iOS developers will still need to know Objective-C for a long time.

All the iOS APIs are still in Objective-C.
Apple only introduced a new language but didn’t rewrite all the old frameworks in it. Nor it did go through the huge amount of work required to update the APIs to Swift. What it did instead was to make Swift and Objective-C compatible so they can interoperate and coexist. Even the new APIs introduced in iOS 8 are still in Objective-C. You will need to know it to use any existing framework.
The frameworks’ APIs are not the only thing that is still in Objective-C.

Many useful third party libraries developed through the years are not going to be translated to Swift overnight. Some developers have been already hard at work to make this happen, but many more will be busy on other things. So, for a long time, a huge part of iOS existing code will be in Objective-C. This also include all the codebases of apps created until now. Rewriting code that works almost never makes sense and nobody is going to spend time doing it. Unless you are going to work on a brand new app, which will be completely written in Swift from the start, you will have to read and maintain old code written in Objective-C. This is going to be true for years.

Even new apps that will be created after the release of Swift 1.0 are not necessarily going to be written in it from the first day. Apple has been changing the language a lot through the beta versions, breaking existing Swift code. Apple is reserving the right to grow the language in a way that will keep breaking code. For some time many developers that want to have a maintainable and stable codebase will still be writing it in Objective-C.

If this wasn’t enough, code is not the only thing that is not going to change in the short term. Documentation, books, tutorials, videos, blog posts, Q&A websites are all in Objective-C at the moment. If you search for “How to do X in iOS” chances are that the answer you are going to find is going to be in Objective-C and not in Swift.

If you want to be an iOS developer now, and for quite some time, you will need to know not just one language, but two. even though you might not need to have the same skills in both. This puts in a better position experienced developers that already know Objective-C, not beginners approaching the iOS platform for the first time. For a long time companies are going to need developers that know both languages. To me it looks that the barriers to entry were raised, not lowered. This is going to be true until the moment in which Objective-C will not be so dominant anymore and it will make sense to only learn Swift. For how long is this going to last? I don’t know. My guess is at least for a couple of years.

During this time, iOS developers will need to keep their Objective-C knowledge fresh. New developers who will learn iOS development in Swift first, will need to add Objective-C to their toolbox.

Comments

Popular posts from this blog

Swift Learning Roadmap

How to Apply for an iOS Developer Job

Partitioning and Naming Drives (Windows 8)