1 min read

Apple’s programming language Swift: 5 things to know

Apple_India

 

At the WWDC 2014 keynote, Apple introduced a new programming language called Swift, which is said to make writing apps for iOS and OS X easier. It will take over from Objective-C as the programming language of choice for the iPhone maker’s two popular platforms. Here are five things you need to know about Swift:

New for everyone
Swift is a completely new programming language built on the LLVM (Low Level Virtual Machine) compiler and runtime, which are also used in Objective-C. The first app built on Swift is the WWDC app itself. Apple has released a guidebook for the language in iBooks Store. Apple itself is making an “interactive playground” for developers who will want to use Swift, which will be seen in coming time.

What’s so great about it?
The reason behind introducing Swift was to make it easier for developers to create apps for Apple’s mobile platform. CEO Tim Cook said that with Swift, developers can now do away with entire categories of the common programming errors that plague their code. Basically, it cuts through the clutter and helps make programming easier.

Makes better, more stable apps
In the WWDC demo, Apple showed that complex object sort runs 3.9 times faster on Swift than on Python; Object-C, in comparison, runs 2.8 times faster than Python. It also includes what developers want to see in their programmes: Generics, closures, type inference, multiple return types, operator overloads etc.

Developers will also be able to test apps more easily, so the code for complex apps can be written faster. They would even be able to make apps that are tested better, that too in less time.

Co-exists with Objective-C
Though it is meant to eventually replace Objective-C, Swift will co-exist with the older language. Developers who have written some part of the code in Objective-C can write the remaining part in Swift and it will work, according to Apple. It also has access to Cocoa and Cocoa Touch, which developers have been using in Objective-C.

But does everyone want it?
It is difficult to assess everyone’s reaction to a new programme that affects nearly 200 million users, but the general sentiment towards Swift has been positive. While it means that developers will have to learn an entirely new language from the scratch, it also means writing apps becomes an easier process in the long run.

Objective-C is approximately three decades old and widely used due to the reach of iOS, so all developers are familiar with it. Apple says that Swift will feel familiar to long-time developers, but will also be friendly to the new generation of programmers.

When Apple announced Swift, developers in the audience were ecstatic. Similar was the situation online, where developers who could not get entry to WWDC took to Twitter to express their joy. Here are a few reactions to Swift:

Leave a Reply