For New Projects, Swift or Objective-C?
In the coming days I will be launching a new app on the App Store. I built this application for my wife three years ago after watching her use another app to help grade papers. Because of my employment at the time I could not release it, but now I will be doing so.
This fall I rewrote it from scratch in Swift for iOS 8, and I really enjoyed it. Learning Swift, the good and the bad, was fun. Now, I am looking down the barrel at two new independent projects, one iOS and one OS X.
Objective-C was never a language I felt fully comfortable with. I was competent and was able to build several projects, but I never loved it. I enjoyed the power and flexibility of the Cocoa frameworks, I loved making apps for the iPhone and iPad, but Objective-C never completely fit me well. It was a means to an end.
Swift is a different story. While there are still wrinkles in the language and the community is working through best practices and conventions, it is surprisingly capable for a new language. Apple made a smart move in using the Objective-C runtime and working to make sure it was interoperable with Cocoa frameworks written in Objective-C. This is certainly where the power and flexibility come from. But the language itself is comfortable. It takes many of the things I like from other languages and melds them into a tool that really works for Cocoa.
For my next two projects I will almost certainly write them in Swift, unless I run into a technical limitation, because it’s simply more fun. I am considering Objective-C for one of them, solely to make sure I stay sharp with the language, but I’d be surprised if I do.
It may be reckless to adopt a new language so readily, and I may regret it, but I don’t think so. I cannot imagine Apple pulling back on Swift support after the start its had. For the time being I will be plunging into the near future with Swift. We’ll see how it goes.