The biggest reaction from the crowd at WWDC today wasn’t for a shiny new product or even a cool new app. Instead, the news that Apple was introducing its own programming language, Swift, got a full-throated roar of appreciation from the thousands of developers in attendance.
Even without knowing a thing about programming, it's easy to understand this is a big deal: Apple's current language of choice, Objective-C, has been in the mix for Macs since the launch of OS X, and for iPhones and iPads from day one. For Apple to throw out the developer playbook across its entire product portfolio suggests there’s a big change afoot — and many devs aren’t sad to see it happen. "[Objective-C’s] a real pain," says Alex Chung, the co-founder of Giphy, who has created multiple iOS apps. "If you’re off by one character it all falls apart. It’s just really old school, you know, it’s like speaking Latin."
Swift is trying to borrow the best elements of moderately newer popular languages like Python and Javascript. "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," says Chung.
Compared to the more complex Objective-C, the drawback of these simpler languages is performance — but Apple says Swift will mean a no-compromise solution. "Swift seems like it finally gives the developers in the iOS world the ability to do the things you have been able to do in the scripting world but without the penalties," says Daniel Doubrovkine, the head of engineering at Artsy. "That’s if it delivers on its promises, and others have promised and failed. But the fact that Apple is behind it gives me a lot of hope its the real deal."
The other big idea behind Swift is that programmers can write their code and see the results in real time. In the old paradigm, developers write line after line of code in a text box, then compile those results — sometimes a lengthy, painful, productivity-denting task — and wait to see the end result. The product and the process were distinct from one another. With Swift, they can tweak a parameter or algorithm and watch the changes happen right away in the same coding environment. Theoretically, this means developers can toy with concepts faster and make what they’re trying to make in less time.
"The live coding concept is really the future," says Jeremy Olson, the founder of the app development company, Tapity. "It’s got the dynamic stuff you would see working in web development, but with Swift it also works in deep code and algorithms."
Both Chung and Olson say Swift will lead to a far deeper pool of developers focused on Apple products — and with them, a lot more apps. "The big story is that this makes iOS development way more accessible," says Olson. "It’s not just because the code is easier to master, but also the live stuff. It’s gonna create a much nicer learning environment." Of course, there’s no shortage of apps on iOS as it is — and with more developers, this could all lead to a new glut of crappy apps to sort through. "This is meant to bring in a whole new breed of young coders, which means an already crowded market is gonna get a lot worse," says Chung.
Given the continued expansion of Apple’s smartphones and tablets into new parts of the world, however, most developers aren’t too concerned. "There is plenty of room for more developers," says Doubrovkine. "If this works like they say, and makes my life easier, than I think it’s a very good thing."
Will the arrival of Swift make a difference in the day to day lives of the average consumer? It won’t — at least, not in the same way countless user-facing features in iOS 8 and OS X 10.10 will. But it does stand to take a lot of the busy work away from the developers making the apps we use every day — and if those devs are able to become more creative and efficient, Swift might have the biggest impact of all.
Comments
Now I know what I’m doing next weekend.
By masands3 on 06.02.14 6:52pm
For everyone that want to learn more: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/index.html#//apple_ref/doc/uid/TP40014097-CH3-XID_0
By Jesper Lundgren on 06.02.14 7:00pm
Positive.
By UrbanTilapia on 06.02.14 9:55pm
As an aspiring computer scientist and developer I’m really excited about Swift and Xcode 6, but unfortunately my best shot for now is to experience the beta version on a virtual machine or worse… wait till fall :(
By Magi King on 06.03.14 12:23am
you got that mixed up. better you wait till fall.
By 0x18fc1529 on 06.03.14 4:06am
You can still learn the basics without that experience. There are some good tutorials available now. You can try one: Swift – Learn By Doing . This course has quizzes to practice the basics also. So get some early experience.
By SajjadRobin on 07.07.14 8:24am
Do u even Hackintosh bro?
By mohdtaufiq on 06.03.14 10:44pm
How exactly do you hackintosh? I’ve wanted to do it for years, but it just seems so risky.
By brinary001 on 06.04.14 2:51pm
This ebooks can be downloaded from here in various formats: http://www.iphonetransferrecovery.com/Swift/free-ebooks.html
By Kidnznet on 06.03.14 1:00pm
More learning resources. A bunch of tutorials as well as code samples on here:
http://www.LearnSwift.tips
By ziggymo on 06.03.14 5:13pm
This looks really exciting for new studios
By lvl85beardruid on 06.02.14 7:36pm
I am joining you
By franciscogutierrezmx on 06.02.14 10:54pm
Finished reading the book about 3 hours after the keynote. From what I have found so far with actual live development it has benefits over Objective-C but you can also see a lot of what the intended purpose for Swift is. It’s core principle is simplification of the apple language, and also a way to distance itself from C. Now as a cross platform developer that means for me I won’t get to have much of the benefits that a core developer only programming in swift will gain. While they say you will see a 30% increase that is only true if you have no intention in talking to other languages. If you wan’t to call a C method you have to call the Objective-C interface that then calls the C method itself. This will most likely cause an overhead cost that is higher than just having Objective-C handle the work and fire the C method itself.
I wish it supported the notion of private/public types as while thats all just editor checks it can be very useful while developing. I think for me while it has a lot of potential its proprietary nature and lack of compatibility will most likely prevent me from using it heavily in any future projects.
By Xtreem0 on 06.02.14 11:31pm
The Playground is great, but we’ve really had the equivalent of that in Smalltalk forever. Still, it is really good to see.
The two things that bother me are:
- Dictionaries and Arrays make a copy of themselves instead of returning a reference. Except it is even more complex than that, as Array behaviour varies according to whether you are changing the set size of the Array. Tell me that is not going to create a lot of bugs.
- As a somewhat hard-core O-O programmer, I avoid Switch/Case as much as possible (Smalltalk in its traditional form does not supply them, for example), using the kind of selector dictionaries David Chisnall and others have suggested, though in something like streaming XML I convert the tagname to a selector and apply that to the destination object directly. So I’m disturbed to see how much these figure in the current docs.
The real thing is, if you are going to come up with a new language, why not at least do some really new things, such as those pioneered in the Self language, Prototype-based inheritance (which JavaScript copies from Self) and the Morphic design pattern for the user interface, which essentially enables you to combine elements of MVC into single multipurpose objects?
Instead of a developing a powerful new language, Apple has actually tried to develop a popular one. That’s understandable, but I just expected something a little better. I don’t think Bertrand Serlet would have let this happen.
By tScottLewis on 06.03.14 7:35am
Ah yes, what your seeing is the C# style of class vs struct handling. In the specs if you use a struct it will only pass as value, while if you make your object a class it will pass as reference. It is a little odd that the dictionary and array’s are structs as I don’t know of another language that behaves the same way. What they did to enums is really bizarre as well allowing you to attach methods to them. The biggest cool feature to me for Shift is the multiple return option though I guess most languages you just pass a struct if you want to do the same thing.
Haha I wrote a fix one for the prototype behaviour in JavaScript as you can’t do multi inheritance well otherwise, also the “new” keyword is a broken version of their original concept of the true prototype which is Object.Creae(). Now the new ECMA version might fix that but this is what I came up with for the time being https://github.com/Kabe0/AVObj (This was used for an app like website I was building).
Don’t avoid Switch case statements! they are a godsend! first off they are a lot faster than if/else blocks, and if your using a language that supports enums they are even faster! The main use for switch cases are for things like finite state machines. If you have something that has multiple states then use a switch as you can then have an update loop that runs in a current switch case, then whenever you want to change it fire setState( ENUM_NAME ); which will have its own switch case which will modify the state machine. Enums prevent you from having an unmanageable amount of bools which is why they are always useful with complex classes.
By Xtreem0 on 06.03.14 2:35pm
My understanding is that you can call C directly from Swift without going through the ObjC interface. The part that’s not there but being worked is the C++ interaction.
By ochowie on 06.03.14 4:43pm
If you can figure it out let me know, as currently the only thing I can do is grab a C pointer and play around with the data inside of it. Not quite what I am looking for haha.
By Xtreem0 on 06.04.14 11:12am
While you dither others will do and in some cases get rich.
By DanoX on 06.03.14 5:52pm
Let me meet you this weekend. I will join you. :)
By iChandu on 06.03.14 10:50am
Reading that made me cringe.
By FezJ on 06.02.14 6:59pm
I think they mean Scala
By Jesper Lundgren on 06.02.14 7:00pm
no it was meant to be Javascript and Python
look at Swift’s syntax, it looks like a cross between Javascript and Python
By ty222 on 06.02.14 7:20pm
Look at scala syntax and compare it to Swift…
By Jesper Lundgren on 06.02.14 7:23pm
scala is not popular as javascript and python is for new developers
By ty222 on 06.02.14 7:40pm
Scala?
I’m a programmer, and I’ve never heard of that before.
By cookies4you on 06.02.14 10:20pm