Smartphones running on Windows are built using c#, whilst native Android apps are created using Java. Up until recently, it was common practice to create native iOS apps using the programming language Objective-C, which was developed in the eighties. Objective-C has been criticised for its rigid syntax. It is hard to learn and difficult to use, making programming with it more time-consuming and expensive. Consequently fewer developers wish to learn and use it. But in July 2014, Apple unveiled a completely new language: Swift. It was created for developing iOS apps and OS X, and was intended as the successor of Objective-C.
Swift is sometimes subject to controversy because many developers are reluctant to embrace it. Learning a new language is challenging, and though Objective-C and Swift can work side by side, having to remodel apps built on Objective-C alone can be time-consuming. This is because the language has not been around for very long, and is not compatible with older code libraries – so re-coding can be very tedious. But the benefits of using Swift far outweigh the initial disincentives. We’re not looking back, and here are a few reasons why.
It might only have been in the mainstream for eight months, but in regard to iOS apps, Swift is a very safe language. Broadly speaking, it handles information more intelligently than Objective-C, and is therefore less susceptible to malicious code.
It’s faster and more resistant to crashes.
Swift allows for better memory management, meaning it is more efficient at retrieving information, and hence more resistant to crashes. Compare an app built using Swift to an app built using only Objective-C, and you’ll notice the difference in performance and speed.
It’s more intuitive and less conducive to bugs.
Swift offers a coding aid called Interactive Playgrounds. Here code can be entered on the left side of the screen, and outcomes are simulated in real-time on the right side of the screen. What’s great about it is that it’s a simulation – it allows you to see what effect your changes will have, before you submit those changes to the final app code. So it’s much easier to learn and master.
It’s attractive because it’s easy to learn.
The implications of this are massive and should not be underestimated. The combination of Swift being easy to understand, and being highly intuitive to learn due to Interactive Playgrounds, makes Swift a fundamental programming language with very low barriers to entry. It provides a huge incentive to learning Swift over other app programming languages. The modern syntax also works against bad programming habits.
Most developers are currently testing the waters and relying solely on Objective-C. Some are starting to use a combination of Objective-C and Swift, as the two are compatible. As part of our mission to seek out the most innovative development methods, the Poq developer team is moving all of our clients’ iOS apps to Swift in the coming months.
“Swift allows us to implement complex features much more efficiently than Objective-C does. Our platform statistics show that our clients’ apps are crash-free 99.3% of the time, and exhibit very fast response times – 351 milliseconds, on average. After we move our iOS apps to Swift, we expect crash-free time to increase to 99.9%, and response time to be cut by nearly half.” – Our CTO, Jun Seki (Github | Stack Overflow)