Mobile // Mobile Business
Commentary
6/27/2014
09:06 AM
Erik LaMana
Erik LaMana
Commentary
Connect Directly
RSS
E-Mail
50%
50%

Apple Swift: Should CIOs Bite?

Swift, Apple's new programming language, has developers buzzing. Should IT execs turn their dev teams loose?

IT teams are scrambling to figure out just what Swift means for their mobile app strategies, from both a development perspective and for potential business advantages. As you might expect, there's skepticism from experts reluctant to add yet another tool to the mix. And, there's some resentment at still being tied to Apple's proprietary platform.

But for the most part, mobile developers are doing the Snoopy dance as they start to delve into the nuts and bolts of the Swift language.

What's all the excitement about? With Swift, Apple promises that mobile apps developed by iOS and OS X programmers will run faster and more smoothly than apps developed with Objective-C, the 20-year-old programming language currently used by most Apple platform developers. A more modern option, Swift takes features from languages like JavaScript and offers the "power of Objective-C without the C" to create a new level of interactivity on the iOS platform. This makes Swift a robust development tool for social networking apps and 3D games.

Some challenge Apple's claim that Swift represents a faster programming tool, especially since it's considered a "friendly" language. Yet there is much more that goes into the speed of a language beyond the syntax; for example, the effectiveness of the compiler and the type of runtime have significant impact on speed. With Swift, Apple is in full control of the language and has included new features that allow for more efficient optimizations within the LLVM compiler. These make the binary code run faster and more efficiently. For example, Swift developers can specify that all objects are of the same type, so when developers iterate through them, they don't have to make additional calls to check class type before making calls, as they must do using Objective-C.

[No one disputes the convenience of public cloud services. But when you look ahead a few years, the cost picture for enterprises is murky, even in light of the price war among Google, Amazon, and Rackspace. What's your take on the ROI reality? Tell us and enter to win a Fire HDX.]

Swift also includes elements of functional and Object-Oriented programming. For instance, Swift adds additional layers of abstraction that support code reuse on a level not previously possible. Developers who view the complexity of C and Objective-C as a barrier to entry might have an easier time. Javascript, Python, and Ruby developers will see something of their own languages in Swift. By leveraging Xcode's powerful code completion and accessible documentation, developers coming from these languages should be up and running on Swift in no time.

Moreover, since Swift is tailored for Apple's APIs, Cocoa, and Cocoa Touch, iOS developers can more easily use compact expressions when writing code for app construction. Whether writing for games or traditional apps, there is often a lot of repetitive code in the form of loop configuration or bulk modification. Swift brings sensible functional elements into play, reducing the amount of time and overhead for these operations.

In short, I see Swift as good news for businesses looking to deliver strategic mobile apps in a timely and cost-efficient fashion.

As part of the Swift announcement, Apple did include a few sticks to go with the speed carrots. For example, it introduced Playgrounds, which provide a REPL (read-eval-print loop) environment with significant developer and debugging feedback that won't be available to Objective-C developers. Although Swift code can run alongside Objective-C and C in the same application, the Playground feature provides a preview of what's being programmed by constantly looking at code and evaluating it, without the need for compilation. During Swift's introduction at WWDC, Apple CEO Tim Cook demoed how a developer could visualize a flight path of an in-game blimp (in real-time, no less) just by tweaking a few lines of code.

So are Objective-C's days numbered? Not necessarily. Some mobile development problems are still best solved by Objective-C or C; for example, manipulating raw data, like with a binary format. On top of that, there are 275,000 registered iOS developers in the United States alone, most of whom are familiar with Objective-C. Some may switch to Swift, but the majority will continue to build using the language they know and trust.

And, developers using Swift still need to know Objective-C well to write apps, since there is a huge collection of APIs and libraries that are written in Objective-C (including Apple's Cocoa and UI Kit).

The opportunities (and fear factor) Swift presents remind me of when Microsoft introduced C#, a multiparadigm programming language built on the syntax and semantics of C++ to allow C programmers to take advantage of .NET and the common language runtime. At the time, Microsoft pushed hard for the language's acceptance and, whether by design or circumstance, the attention it gave C# adversely affected developers using its former top language, C++ (no, not Visual Basic). It was not a pleasant experience to be a Microsoft C++ developer around that time. As new C# tools like Visual Studio rolled out to the booming software development world, the C++ crew was left to languish.

The danger with Swift is that this scenario could happen again, with Objective-C developers doing the languishing.

We won't know the full implications of Swift until developers have a chance to use the new language and suss out the true productivity gains. But CIOs should encourage dev teams to take a look. Apple added features, such as closures, templates, generics, and default parameters, that Objective-C developers have long pined for. These features enhance the expressiveness of the language and allow developers to write code in a more concise and understandable way. We may not see any improvements considered earth shattering, but in time, I expect positive outcomes as the development community figures out new and elegant ways to solve problems using Swift.

From a business perspective, Swift may be a new language, but it already has vast support and libraries. There's little risk of the issue that sometimes hounds newly introduced languages, as developers stare at the screen asking, "What do I do with it?"

A bigger risk for businesses is not having skilled development teams to tap into these programming languages. We live in a rapidly changing mobile world. Swift can help you keep up.

Managing the interdependency between software and infrastructure is a thorny challenge. Enter DevOps, a methodology aimed at increasing collaboration and communication between these groups while minimizing code flaws. Should security teams worry -- or rejoice? Get the DevOps' Impact On Application Security report today (registration required).

Erik is a Senior Software Engineer at WillowTree Apps, where he is responsible for developing custom iOS applications for clients. He has extensive multi-language development experience (Objective-C, C/C++, C#, Java/J2EE, Python, HTML, PHP) and is credited for his ability ... View Full Bio
Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
cirogutenberg
50%
50%
cirogutenberg,
User Rank: Apprentice
7/21/2014 | 7:56:03 PM
Swift training 70% off
It was about time to go beyond C.... Just found a nicely discounted Swift course on Udemy.... 70% off till final release....

https://www.udemy.com/swiftdeveloper/?couponCode=SWIFT-29
JulianF921
50%
50%
JulianF921,
User Rank: Apprentice
7/3/2014 | 3:42:15 AM
Transition
Personally, I'd be looking at a transition strategy. History suggests that when Apple makes a move like this, it's only a matter of time before 'legacy' support is deprecated.

i.e. with the switch to OS X, first developers had the option of their apps running in a 'Classic' sandbox, which disappeared with the move to Intel.

The next step was Carbon -this was created in response to developer complaints over being forced to use Cocoa/Objective C, and was a set of APIs that made it easy to port earlier applications to OS X. That finally died in the transition to 64 bit, but the warning signs were there before.


The key point will be when Apple start developing new APIs with features that only work with Swift, and redeveloping their own code to use it - this won't be for a few years yet, but you see the start of the process with Playgrounds.


It is pretty evident that this is not - like MacRuby - an optional alternative to writing in Objective-C. This is, like C#, the official future.

Of course, most CIO I know are still persuing lowest-common denominator cross-platform solutions, and I don't see Switft changing that. Few applications need deep platform integration or performance.

 
InformationWeek Elite 100
InformationWeek Elite 100
Our data shows these innovators using digital technology in two key areas: providing better products and cutting costs. Almost half of them expect to introduce a new IT-led product this year, and 46% are using technology to make business processes more efficient.
Register for InformationWeek Newsletters
White Papers
Current Issue
InformationWeek Tech Digest - August 27, 2014
Who wins in cloud price wars? Short answer: not IT. Enterprises don't want bare-bones IaaS. Providers must focus on support, not undercutting rivals.
Flash Poll
Video
Slideshows
Twitter Feed
InformationWeek Radio
Sponsored Live Streaming Video
Everything You've Been Told About Mobility Is Wrong
Attend this video symposium with Sean Wisdom, Global Director of Mobility Solutions, and learn about how you can harness powerful new products to mobilize your business potential.