Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Mobile / iOS

Admiration for Swift

4.58/5 (6 votes)
10 Jun 2014CPOL2 min read 17.9K  
Finally iOS developers get a new programming language as advanced as C# and Java

Apple recently announced a new programming language for iOS and OS-X app development – it has a nice name “Swift”.

As of now, the best source to know more about this programming language is Apple’s iBook – “The Swift Programming Language” downloadable from iTunes. Of course, very soon, we will find many books on Swift in market.

Developers who were writing programs using C# and Java have been reporting how difficult and time consuming it is to work with Objective-C. Actually, it was just the magic of elegant design of iPhones and iPads along with UI framework that supported iOS developers to write great apps. Underneath those great apps, there exist highly rudimentary, tiresome to write, difficult to read and analyze source code written in old age Objective-C programming language.

The best thing of Swift that I liked is its programming constructs are consistent with other advanced programming languages – C# and Java. Looks like Apple has realized that today’s typical developer just does not develop iOS applications – today a developer wants to develop apps for other platforms including Android and Windows. Gone are the days when a developer used to write programs in only one device and application platform throughout the life.

Playground is another interesting feature. Programmers frequently need to try a code block to test how effectively it works. A typical mechanism developers use is to create a very simple console app and run that in debug mode. Playground, integrated with Xcode, is very helpful in such scenarios. It allow developers to write code snippet and test it how it works as well as how it performs.

Let's expect new generation of app developers would prefer Swift and skills availability for Objective-C in market would go down.

Considering increased consistencies across major programming languages – expect new generation of app developers would have multi-platorm app development skills.

Is there code refactor or code conversion feature available for Objective-C to Swift? Not as of now, probably such feature might be available in future – but then let's not expect that code conversion to do all your job. Swift brings many new capabilities that have to be planned and implemented as per specific app requirements.

Sooner or later, all iOS developers will have to learn this new programming language. Existing iOS app developers should evaluate their apps and lifecycle to decide whether its source code should be converted to Swift. As a simple strategy – consider migration from Object C to Swift if iOS app is expected to continue serve beyond 2014.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)