In the last WWDC, Apple introduced Swift 2 as an update of Swift, its programming language for IOS, OSX, WatchOs and TvOs. Created to improve the efficiency and performance to develop apps and program devices, the new version of Swift includes some attributes that might change the way we understand programming.
Swift 2 includes new features that make writing code simpler and more intuitive like the Xcode 7 tools that allow you to build apps that run directly on Apple devices or the possibility to use protocol extensions. But one of the main features that make Swift so relevant right now is its open-source code. By making Swift open source, Apple is opening the possibility to build new apps for non-Apple operating systems.
In addition, it includes a new error handling model that makes easier to catch and throw errors, a faster compiler and new Objective-C features such generics and nullability annotation. New syntax improvements that make the code safer and cleaner.
Swift for iOS and Android
Swift is not only the programming language of one of the biggest technology companies in the world. Swift has also major support from IBM and a variety of apps like Lyft, Pixelmator or Vimeo. Apple created Swift as a substitute of Objective-C, but their intention was not only to improve an old programming language - remember that Objective-C was created in 1980- but to open the boundaries of coding with an intuitive and easy-to- read language that would make easier for developers all around the world, to build their own apps and even operative systems. The developer community can contribute to this programming language.
But, by making Swift open source, the big questions are if developement companies will see iOS apps running on Android devices and what this means for Google. The answer to the first question is easy.
Although Swift allows us to build apps on different operative systems, Apple still retains control of its SDKs (Software Development Kit) so developers will still be using a Mac to develop OS x and iOS software.
About the question, if Google would migrate to Swift, we need to take into account that the portability to Android is not so easy. Google would need to make its entire standard library compatible with Swift and some APIs built with C++, would have to be rewritten as well since this language is not compatible with Swift.
But these obstacles do not seem so important since Google is considering the possibility of making Swift its first-class language. By the moment, Android currently supports Java, but as you probably know, Google is involved in a litigation process with Oracle that claims a larger quantity for using Java. Things seem to be easier now that Swift is open source, but the company needs to evaluate the benefits of moving to Swift, the language of one of its main competitors.
Some sources argue that Android is also evaluating the possibility of using Kotlin as first class language. Similar to Swift, Kotlin is also object oriented. Focused on safety, Kotlin works with Android Studio, Google’s IDE for Android development what could make the migration easier. But according to some experts, Kotlin presents a disadvantage in relation to Swift that could change Google’s plans, it seems that Kotlin is a little bit slow when compiling.
Advantages and disadvantages for developers
Talking about Apple means talking about high-quality products and reliability, and this is also applicable to developement companies' universe. Swift presents important benefits for developers:
But nothing is perfect, and Swift presents some areas of improvement especially when working with other systems:
Alternatives to Swift for app development companies
There is a long list of programming languages that can be used as an alternative to Swift.
As we have said before, Google uses Java but there are many others like 4th Dimension, AppleScript, BETA, Objective C, Google AppsScript, Lindo, Lingo, Visual Basic or .NET. Each of these languages offers different functionalities and benefits, depending on what mobile app developers want to build.