Stop the funeral! Objective-C is alive and kicking

Objective-C may no longer be the stylish language choice for Apple iOS and Mac OS development -- that mantle is being assumed by Swift, introduced in mid-2014. But proponents of Objective-C don't expect it to go away quietly anytime soon.

In fact, they believe it will be around for many years due to its familiarity and stability. "Apple is going to be supporting Objective-C for another decade," says Aaron Hillegass, CEO and founder of Big Nerd Ranch, which provides mobile app development and training, including in Apple-based technologies such as iOS. "I think you'll be able to write new iOS and Mac apps using Objective-C for at least a decade."

Naysayers have not been optimistic about Objective-C. An InfoWorld article in May, in fact, cited 10 reasons for moving to Objective-C, including that it's easier to read and maintain, as well as safer, faster, and requiring less coding. Swift is positioned by Apple as offering concise yet expressive syntax as well as being interactive and enabling development of fast apps. Other Apple documentation, however, still cites Objective-C as "the primary language" for writing iOS and Mac OS software.

Plenty of investments in Objective-C

Apple app builders still stand in Objective-C's corner. "There is too large of an investment by Apple in existing Objective-C code for there to be any cutoff of Objective-C support anytime in the medium term -- four to seven years -- and quite possibly for the long term -- 10-plus years," consultant Christopher Allen says. "However, you may see at some point in the future APIs will be available as Swift-only APIs, but even this is not likely for years. If that happens, it will be the real harbinger that the end of Objective-C is on its way. Otherwise, a eulogy is premature."

Even Hillegass's recent presentation, entitled "A Eulogy for Objective-C," turns out to have a twist, proclaiming, "Objective-C is not really dead." Hillegass says during his speech, given in June in San Francisco: "I have to admit that I really love Objective-C. Everyone's been talking about what a wonderful language Swift is and it's a nice little incremental improvement Objective-C. But it's not really a radical departure." Objective-C, he says, has allowed him to build class structures and do low-level programming without having to work too hard. Hillegass says he is a 20-year Objective-C veteran.

An Objective-C developer who wrote an essay, "Why Objective-C is Doomed," last year, calling Swift transitional and not complementary, also sees life left for the language. "The question I think everyone really wants to know is how long will Apple support Objective-C," author Sam Ritchie now says. "This will be measured in years."

Ritchie says he sees the "volatility" of Swift as still an issue. Some developers will not adopt until they are confident the language will not change each release of the Xcode IDE. He also sees iOS 7 support as an issue. Swift runs on iOS 7, but "there's no dynamic library support, so third-party Swift libraries are more difficult to incorporate."

Swift was explicitly designed to operate with Objective-C, indicating Apple's expectation of a lengthy transition period, Ritchie adds. "At a guess, I'd expect deprecation to be at least four to five years away, although we may see new Swift-only frameworks from Apple sooner than that, pending stabilization of the Swift API."

Apps, frameworks still rely on Objective-C

An Objective-C instructor with Code School notes the many apps built with the language. "I think Objective-C is still going to have a great future," says Jon Friskics, an iOS developer. "I don't see it going away. There's just so many apps that are built [with Objective-C]." Friskics sees Objective-C going strong for at least the next three to five years.

Allen adds, "You still need to understand Objective-C to do complex Swift apps -- Mac and iOS APIs are still largely optimized for Objective-C. Eventually these APIs may become deprecated and replaced with Swift-centric ones. But that will take some time."

Swift, Allen says, "is still somewhat of a Frankenstein beast -- it is a next-generation language, but has to support the previous generation of APIs, so [it] has many constructs that are not as modern as the language. Maybe there will be a point where there's a Swift version X that sweeps out all the old stuff, but more likely there will someday be a new language that is a successor to Swift without the legacy."

Hillegass cites Apple framework dependence on Objective-C. "The frameworks that Apple has built everything on top of are all written in Objective-C." These frameworks include Cocoa, CocoaTouch, AppKit, UIKit, and others. Meanwhile, features such as generics from Swift are being added to Objective-C, he says.

Ritchie sees Swift as the choice for newcomers. "Swift is most popular among developers new to the platform who aren't already invested in Objective-C, although most developers I speak to are comfortable with -- or at the very least resigned to -- eventually moving to Swift," he says. "However, this seems to have less to do with the safety improvements and more either the syntax or acknowledgement that it's 'the future' and they don't want to get left behind."

Copyright 2019 IDG Communications. ABN 14 001 592 650. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of IDG Communications is prohibited.