Every year after WWDC, I have the urge to throw away half of my existing code and start using all the new APIs and frameworks from day one. With all the announcements and most noticeably the introduction of a new programming language, this year is no different.

At the conference, I heard the following a few times:

”We don’t want you to rewrite your perfectly good Objective-C code in Swift.”

Apple has provided us with a fast and easy way to achieve interoperability between the two languages and the transition will be a gradual one. The cost of rewriting a project is and will be much higher than the cost of maintaining the old parts of it. In fact, since history has a tendency to repeat itself, in a few years, Objective-C developers will be a valuable (and highly paid) part of any development team.

That being said, I think rewriting a whole project would be the best learning exercise in order to get into Swift. Sure, reading the official book and experimenting in playgrounds is a great idea, but getting some real world experience with the language will make you feel much more comfortable with it.

Your sideproject is a perfect candidate

Right now, Swift 1.0 is still in development and many parts of the internal implementation and syntax are not final. The App Stores will not be accepting apps written in Swift for a few more months, so this means that it is not a good idea to use it in a project or update you plan to ship soon. Also, in order to get quick results, you should start with a relatively smaller project. How about your sideproject? Everyone has a variation of a sideproject. It might be an app you are working on in your free time, or a small framework on GitHub. It might never be ready and it might never go on the App Store, but this is not important. The important part is that the code and its design is your own creation.

New ways to solve old problems

You write code to solve a problem, and programming languages gives you a set of tools to express your ideas. However, every language also comes with limitations that we learn to live with. Taking a block of Objective-C code and rewriting the syntax to Swift will not always work. This is a good thing. Some of the new features of the language, like optionals, tuples, enums and the new switch statements, will give you new ways to express yourself along with new rules to follow. You will find pieces of your code, that can get much more clear and others that can be removed altogether.

New language to address new problems

Apple introduced Swift as a new programming language that is practical and is designed to address the software engineering problems of today(and the future). Getting familiar with the new paradigms as early as possible will enrich your overall programming experience and give you new ideas on how to approach different tasks.

Start today

I have already started rewriting one of my apps in Swift and it is not an easy process, but it sure is fun. My advise is to start out with your smaller Objective-C files one by one. Pretty soon you will have some new ideas on how you can simplify your codebase and take advantage of the new patterns.