Apple_Swift_LogoApple had some interesting news for us at the WWDC 2014. But besides the new flat user interface (UI) OS X Yosemite and iOS 8 – the most surprising announcement was the new language Swift.

This might be a shock for seasoned iOS and OS X programmers as they learned to love Objective-C but Apple announced that it was time for this respectable elder to retire.

But fear not. Old-school developers will still be able to use their beloved C flavored language. In fact both can even be used side by side in the same application.

Why would you learn yet another language then? First, Apple promises huge performance improvements compared to Objective-C. Which might sound surprising at first considering that Swift offers a lot of abstractions.

And the second reason: Simplicity.

Let’s look at the following “Hello World!” in Objective-C

	#import <stdio.h>
	#import <Foundation/Foundation.h>
	int main(void)
	{
	NSLog(@"Hello, world!\n");
	return 0;
	} 

And now the Swift version

	println("Hello world!")

Ok. I here you say “Yeah but an Hello World is not a meaningful example.” Maybe not ! But it’s enough to get the intent. It feels a lot more like modern scripting languages. To get all the explanations check Apple’s official page here and also their manual available on the iBook Store.

swift manual

iOS vs Android

It seems clear to me that what Apple is trying to achieve here is not providing new tools to his existing developers but actually attracting new ones to his platform.

iOS might be the winner for now but I believe the Android developers community is growing fast. And this is for good reason: a lot of junior developers make their first experiences with dynamic languages like PHP, Python or Ruby. Some other come from the Java world. When they first look at Objective-C there are good chances that they are scared and run away.

On the other hand Android lays on the well-known and more friendly Java which seduces easily these newcomers.

Swift might be Apple’s secret weapon to hook up beginners and keep up with the Droid.

The language is still very new; a couple of days at the time of writing and even if some enthusiasts already released some apps with it we’ll need to wait for broader adoption to see if it fulfills its promises.

What about you? Do you think Swift will replace Objective-C? Have you or will you use it? Do you think it’s just a marketing move or a promising piece of technology? Share your thoughts in the comments below.

Yann Irbah

Yann is in charge of developers relations and API evangelism at PAYMILL. Before joining the company he was a freelance web developer and took part in the creation of many startups.