July 21, 2014

The future is Swift

Written By Sam Jones
Scroll

ios8_comingsoon

Introducing Swift

Swift brings a host of new opportunities to the table for any developer interested in developing for the Cocoa platform.

Swift introduces many new features such as; closures, tuples, generics, some functional programming features and a lot more. Some of features will be new to iOS developers because Objective-C didn’t have them. However developers that have knowledge of other languages may be familiar with some of the concepts. This lowers the barrier to entry into Cocoa and Cocoa touch application development. Swift has borrowed some of the best bits from ‘modern’ programming languages such as Python, Ruby and Haskell, just to name a few.

Swift is … swift!

These new features allow developers to write faster and more efficient code, whilst still maintaining code readability which is very important.

Traditionally, interpreted languages are faster than compiled languages. Swift builds and executes considerably faster than other compiled languages. This gives developers the ability to build and test their programs immediately and also execute the compiled code extremely fast.

What makes Swift so fast is the fact that it is targeted specifically for the Cocoa and Cocoa Touch APIs. Due to both of Apples’ languages targeting the LLVM, Swift and Objective-C code can co-exist in the same project which in turn, will help to encourage the adoption of this new language.

Lowering barriers

One of the main problems with Objective-C was that at first glance, it’s a difficult language to learn. The syntax alone is often enough to deter prospective iOS and Mac developers.

Swifts’ syntax is quite similar to the modern languages, with which more developers may be familiar with. This alone serves as an incentive to learn this new language as less time is spent reading and understanding others code, which allows for more time getting things done. Swift re-iterates it beneficial points by offering features such as inferred typing, allowing developers to spend less time on defining types and focus on the crucial things.

It will be interesting to see just how quickly Swift is adopted and more importantly, how it affects the quality of applications we are seeing on the App Store.