Could the new Swift language lure more JVM devs to the iOS side?
Apple surprises everyone by unveiling new Javascript/Python/Rust/C++-influenced programming language.).
let people = ["Anna": 67, "Beto": 8, "Jack": 33, "Sam": 25] for (name, age) in people { println("(name) is (age) years old.") }
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):
Does anyone understand, why Apple reinvented Java? #apple #java #swift— Alexander Alexeev (@afiskon) June 3, 2014
Apple has removed the baggage of C with Swift, time for google to get rid of the nightmare called Java.— Kunal Deo (@kunaldeo) June 2, 2014
#Swift – Apple programming catches up and in places looks like it passes Java and C# – reading the free iBook now— Stephen R. Palmer (@stephenrpalmer) June 3, 2014
Not sure why people compare Apple’s Swift with Scala – more like a grab bag from Java, C, ML, Ceylon. Good news I guess is: ObjC is dead ;^)— predef (@predef1) June 3, 2014
Before breakfast I thought I’d read through the new “Swift” manual. Some nice features. A mix of Java/JS/Python. With Apple’s IDE… wow.— dominic_giles (@dominic_giles) June 3, 2014
Apple made nice move inventing Swift programming language.It’s not new,but adapts closely to C#,Java,Javascript,it has closure syntax! #fb— atthakorn (@atthakorn) June 3, 2014
Apple just won the war. Devs will flock to Swift, leaving Android (and ancient Java 5) in the dust. Get on board now or be left behind.— Joe Bernard (@joebernard) June 3, 2014
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.