News to crunch on

Could the new Swift language lure more JVM devs to the iOS side?

Lucy Carey
java-apple

Apple surprises everyone by unveiling new Javascript/Python/Rust/C++-influenced programming language.

Now, the Apple Worldwide Developers Conference (WWDC) 2014 isn’t
usually something we’d touch on here at JAXenter, what with its
focus on iOS flavoured-topics and all. But CEO Tim Cook’s surprise
reveal of Apple’s new Swift language, to a
rapturous reception
, had our JVM senses
a-tingling.

Why? Well, for a start, there are some aspects
of this new programming tool that those on the J-side may find
pretty familiar. Here’s a nice

overview
of the features so you can compare
for yourself. (Note:  there’s already an
old Swift
language
, designed for parallel scripting on
multicores, clusters, clouds and supercomputers – but if you’re
using that, you’re probably not that bothered about writing the
next Flappy-Angry-Goat-Ladder abomination).

 let people = ["Anna": 67, "Beto": 8, "Jack": 33, "Sam": 25]
 for (name, age) in people {
     println("(name) is (age) years old.")
 }

Example
Swift
code

Up until now, the de-rigueur Apple programming style for OS X
onwards Macs, iPhones and iPads has always been Objective-C, a
 general-purpose, object-oriented programming language that
imbues the C programming language with Smalltalk-style messaging
functionality. It’s a demanding old school language, and makes it
all too easy to mangle code with one mere typo. Swift signals a
clear effort on the part of Apple to bring its coding tools kicking
and screaming in 2014 – and to this end, it’s apparently borrowed
heavily from slightly more contemporary languages such as
Javascript, Python and Rust. There are also elements of


C++ and Java
, such as well-defined namespaces, operator
overloading and generics.

Those happy devs raising the roof at WWDC weren’t just
applauding the fact that Apple now has a trendy new “ego language”
 à la
Go
or even Java: for them Swift, promises to make their lives
an awful lot easier – if they can be bothered to go pick up a new
language after years using Objective-C, anyway.  According to
Giphy co-founder and serial iOS app developer Alex Chung, “These
are just more modern, colloquial languages that more developers
today understand. They are easier to learn, and things don’t break
as easily in them.”

Due to the rich mix of influences within Swift,
there have been reactions from far and wide across the dev-sphere.
Here are just a few diverse reactions from Twitter (for those of a
sensitive dispotion, beware, some of these Tweets may contain trace
elements of anti-Java sentiment):
 

Aside from an injection of well-liked programming conventions
into the fruitbowl, Swift’s other big revelation is its ability to
allow programmers to write and view the results of their code in
real time, neatly circumventing the need for odious, time-sucking
compilation. Tapity’s Jeremy Olson is a huge fan of this
development, telling The Verge: “The live coding concept is really
the future…It’s got the dynamic stuff you would see working in
web development, but with Swift it also works in deep code and
algorithms.”

That being said, merely making it less of a hassle to poke
a toe into the iOS pool isn’t likely to lure across a glut of
established Ruby, Python, or even Java coders – especially when the
market for apps is already fairly swamped. Moreover, Swift is
totally closed source, giving Apple a stake in any code created, as
well as autonomy over approval for distribution and a cut of final
sales – certainly a hard sell to anyone who favours an open source
ecosystem.

What Swift may do, as both Chung and Olson believe, is
open up iOS development for a whole new demographic. Olson affirms
that this is, “not just because the code is easier to master, but
also the live stuff. It’s gonna create a much nicer learning
environment.”  Ultimately though, the future of any language
pivots on people actually bothering to pick it up. It’s this that
will determine whether Swift flies or sinks –  - regardless of
how shiny and well marketed it may be. If you’d like to have a
play and see what’s got everyone so fired up over at reddit/programming,  Apple was kind enough
to rush out the free 860 page
Swift Programming Language manual
as the news went
live. 


Author
Comments
comments powered by Disqus