Apple’s Swift programming language to improve reliability and productivity

Developing for Apple’s desktop and mobile devices has traditionally involved writing software in a language called Objective-C (a language closely based on the traditional C programming language, but that supports an ‘object oriented’ approach to software development). One of the advantages of C-based languages is that they are flexible and relatively fast to execute.

However, such languages are generally ‘imperative’ in style and so are prone to errors that only show up when a program is running (as distinct, say, from when a program is compiled). This is not when you want a user to find an error for you (remember that testing can only ever be partial, and cannot be used to prove software is fault free)!

These languages are also relatively verbose. Verbosity is a bad thing in programming.  More lines of code have to be written, taking more programmer time, and the code is harder to interpret, leading to mistakes during programming and review. Indeed, there is a rule of thumb that the number of faults in a program is proportional to the number of lines of source code in it, so in principal fewer lines should mean fewer errors.

More modern languages tend to be less verbose, infer data types, perform more checks for the programmer, and allow a different style of programming known as functional programming (without necessarily preventing an imperative style when that is best for a particular section of code). The difference between functional and imperative programming may be thought of, loosely speaking, as the difference between instructing the computer in what to do and how to do it. Functional programs tend to be shorter and easier to understand, and many types of runtime error are no longer even possible.

The deficiencies of C-based languages are one of the reasons we have been (and remain) interested in the high productivity and high integrity language, OCaml, as championed by the University of Cambridge’s OCaml Labs among others.  Imagine our excitement, therefore, when Apple announced at this year’s Apple World-Wide Developer Conference (WWDC), held in early June 2014, that it is releasing a new programming language called Swift in Autumn 2014 that appears to offer many of these benefits (although we have not had time to try or assess the language fully yet)! The language will work alongside existing Objective-C programs, and will support devices running the existing iOS7 and OS X Mavericks as well as future versions of these mobile and desktop operating systems (of which iOS8 and OS X Yosemite are due for release in the Autumn).

We are looking forward to getting to grips with Swift and hopefully using it to realise faster, cheaper and more reliable software for our customers.

You can read more about the Swift language here:

For those readers who may want to get into depth, an e-book is already available to the public in iBooks and will be available on other e-book platforms soon, we understand.

Posted in Apple, Apps, Functional programming, News, Security, Software Development, Swift, Technology, Validation