Apple's Biggest Breakthrough That Almost No One Knows About
Ask the average Apple fan to make a list of the important moves the company has made in the past year or so, and the list will probably start with the Apple Watch before ticking off the huge sales of bigger iPhones and the $3 billion deal for Beats Electronics. A particularly news-savvy fan might even cite rumors about an Apple car. Put the same question to an Apple developer, and the list of milestones will almost certainly include something that has flown under the radar of most devoted Apple users: Swift, a new computer language introduced by the company a year ago.
Developers gasped and applauded as Craig Federighi, Apple’s senior vice president for software engineering, first ran through such features as type inference, closures, and multiple name spaces. “You know how many people are home are going, ‘What in the heck are these guys talking about?” Federighi joked when he unveiled Swift at last year's Worldwide Development Conference. People who didn’t care about, say, the speed of RC4 encryption quickly forgot all about those few minutes of confusion. Programmers didn't. Many of those attending this year's WWDC, which starts on June 8, have spent the past year learning how to write apps using Swift.
Red Monk, a firm that has been doing regular rankings of programming languages for the last five years, describes the language’s growth as “essentially unprecedented.” Just seven months after its inception, Swift had become the 22nd most popular language out of the hundreds of major languages that exist.
Universities and informal educational outfits have jumped to fill demand to learn Swift. Ray Wenderlich, a developer who runs a popular website for programming tutorials, said he immediately shifted his focus almost entirely to the new language. “The response was crazy for Swift,” he says. “That’s all the people want.”
There was almost no way Swift wouldn’t lure developers in large numbers. Apple gets to decide which languages can be used to write apps for iOS devices, and legions of coders take heed because the average Apple user generates four times as much revenue for developers than the average Android user. It almost didn’t matter whether Swift was any good.
But it turns out that Apple's new software language has also managed an impressive feat: It has thrust a new language on programmers without inspiring widespread hatred. Early reviews of the language have been overwhelmingly positive, and a survey in February of more than 26,000 developers conducted by Stack Overflow, a website for coders, named Swift the world’s most-loved computer programming language.
Before Swift, the only choice for Apple developers was Objective C, a language initially built in the 1980s. Developers had started complaining that Objective C now felt a bit long in the tooth, calling it verbose, old-fashioned, or just plain ugly. Of course, every computer language worth its salt has partisans and detractors—some programmers are hesitant even to express an opinion about a particular language for fear of being pilloried on Hacker News. When asked whether Objective C was a difficult language to code in, Peter Morelli, the vice president for engineering at ride-hailing app Lyft, dodged the question. “I think that’s kind of a religious war,” he says. “Many people are very productive in it.”
What's driving the rapturous response to Swift? The differences between programming languages are notoriously hard to convey to an audience who speaks only English. Swift gets good marks from developers for safety (making it difficult to add bugs to code) and modernity (offering the same bells and whistles as other trendy languages). Another key factor is expressiveness, invoked by coders to describe the ease of explaining to a computer what you want it to do. Swift is widely viewed as more expressive than Objective C because programmers can get the same results with fewer lines of code. “If you looked at all the squiggly lines and semicolons, Objective C would have four times as much,” says Myers Carpenter, a developer for Treehouse, a company that provides educational courses on various technical topics.
Lyft asked one of its engineers to begin experimenting with Swift about six months ago. It soon decided to rewrite its entire app with the language and expects to complete the process in July. The ride-hailing app coded in Swift will have only about one-fifth the number of lines of code as its previous iteration, and subsequent updates will also take less time. “Going from months to days is pretty nice,” Morelli says. “That’s the main benefit.”
SlideShare, a document-sharing service owned by LinkedIn, is another early adopter. While developers at the company say transition to Swift has been successful, they also acknowledged some growing pains. One issue: The program that converts Swift into a computer-readable format used so much processing power that it overwhelmed the less-powerful 13-inch versions of Macbook Pro laptops. “My co-workers who have 15-inch models with quad-core i7s have a much better time,” wrote Kyle Sherman, a software engineer for the company, on LinkedIn’s engineering blog. “Either way, the fans are quite loud when compiling.”
This is the kind of stuff that gets ironed out as a language matures. Yet Swift’s adoption has happened while the language is still undergoing rapid evolution, making things so unstable that some developers prefer to wait. Colin Eberhardt, technology director for Scott Logic, a software development company, says that Swift updates regularly break his code. “If you are building production code, right now you just don’t want to be using Swift,” he says. Apple declined to comment for this story.
For now, Objective C is still used far more widely than Swift. But if the new language's success continues, it could mean the death of its predecessor. Once the language is stable and established, Apple may well decide it doesn’t want to support two languages and will start requiring developers to use Swift for certain aspects of coding. This probably won’t happen for years, but Wenderlich say he expects it to happen at some point. “Then people will start to migrate to Swift,” he says, "and eventually Objective C will go away.”
For more on code, read this next:
Plus, our special report: The World Belongs to People Who Code
To continue reading this article you must be a Bloomberg Professional Service Subscriber.
If you believe that you may have received this message in error please let us know.