Following the announcement of the Gold Master status for Apple Swift, there has been a marked increase in interest among developers to create apps with the new language. While there’s no room for doubting that Swift is a big improvement over Objective-C, the former is still not quite ready for use as a standalone language.
Swift has been in the news ever since its official unveiling at the Apple WWDC event, back in June. Apart from creating plenty of buzz among programmers and mobile app developers worldwide – Swift has recently been integrated with Parse, the backend service of social media biggie Facebook. In early September, the new language was given the ‘1.0 Status’, and at present, apps created with Swift can be submitted at the store (thanks to the ‘Gold Master’ status). However, there are still certain factors that stand in the way of Swift becoming the top choice for all developers. We here take a look at some of these inconveniences:
- Swift is not as ‘swift’ as promised – There had been all sorts of rumors in online iPhone app development communities about how Swift would be close to ten times faster than Objective-C. Detailed testing of the new language’s beta version has proved that this is far from being in the case. On the basis of several key parameters, Swift is around 1.5 times slower than Objective-C. Developers who had expected Apple Swift to be some sort of a ‘new magic potion’ are bound to be disappointed.
- Lack of Query Parameterization – Unlike Java, which has ‘PreparedStatement’ in its library, Swift comes up short on this security front. This issue assumes even greater importance in the light of the fact that ‘Command Injection’ is currently one of the biggest sources of coding vulnerabilities. Unless the developers at Apple add a query parameterization feature to Swift, the only other alternative would be working with SQLite library. Code reliability levels would remain low.
- Overdependence on Objective-C – Everyone has loved the fact that Swift has not been launched as a substitute of Objective-C – and app development experts can work with the two languages simultaneously. That, however, does not mean a thing for newbies who do not have a proper hang of Objective-C yet. They would have to (like earlier developers) learn the parent language properly, before turning their attentions to Swift. Apple has not made a ‘ready-to-use’ programming solution for new developers. In addition, there is an outside chance that Apple might pull the plug on Objective-C support in future. How would Swift be modified then?
- Optimized for a single platform – Many companies involved in cross-platform mobile app development would be initially reluctant to switch over to Swift. Although Apple has gradually opened up its app ecosystem to third-party developers, the new programming language is still about Mac OS X and iOS only. For Android or Blackberry developers, using Swift is still, and will probably remain, a pipe dream.
- Increase in competition among developers – Which, in turn, might lead to dwindling monetary rewards for individual companies. Leading mobile app companies have confirmed that it does not take more than a couple of weeks to learn up Swift and start making apps with it. Over time, more and more developers would start submitting Swift apps, competition among them would spiral – lowering the per-app returns. What’s more – if people are in a tearing hurry to create apps with Swift, errors/bugs might remain (due to inadequate mobile app testing), and app rejection rates might also rise.
- Absence of Taint Checking feature – Python has it, Ruby has it, but Swift does not. ‘Taint Checking’ is easily the most convenient way to ensure that the key variables in any app/software are not being handled/manipulated by end-users in an insecure manner. Given the importance that Apple has always attached to security considerations, it is rather surprising that Taint Checking has not been a part of Swift to start off with.
- Only experienced developers will find Swift easy to muster – Apple Swift has been positioned as a language that makes the task of creating long, complex codes considerably easier. Its benefits are not as general though. Let’s explain this with an example – only those already proficient in English will find it easy to write shorter, simpler sentences with a new guidebook. Similarly, developers who have been working with Objective-C for some time have advantages to look forward to from Swift. For new programmers, or developers from other platforms – Swift is just another language that has to be learnt, investing plenty of time and effort.
- Will developers with large codebases switch over? – We would have to wait for a couple of months more, for the jury to be completely out on this one. At present though, it seems rather doubtful that iPhone app developers who have built up a large Objective-C codebase over time would jump on to the Swift bandwagon immediately. They might learn the new programming language (the interoperability with Objective-C would help), but the number of Swift-only apps won’t skyrocket any time soon.
- Online tutorials and community support is still not adequate – This is a typical ‘early-stage problem’ for any new language. For all its advantages, there is still not much in the way of online learning communities and resources (there are certain textbooks, but developers have to buy them). As the community support for Apple Swift grows stronger, people would be able to clarify doubts and queries on a real-time basis. As of now, that is not impossible – but mighty difficult.
- Using AppKit and UIKit – Here we go again – another offshoot of the dependence on Objective C that is likely to frustrate mobile app developers for at least a few months. A developer who needs to work with AppKit and/or UIKit can only do so when (s)he uses Objective-C (the features won’t be available otherwise). Source codes, pieces, and even external libraries can be accessed only via Objective-C, and not only by Swift. Let’s just say Swift does not yet have the legs to stand on its own.
- Trade-off between advanced features and time-based efficiency – High-end playground simulation, simpler coding procedures (at least for experienced programmers), runtime code checking and mobile app testing – Swift has a host of attractive new features on offer. However, the same features have another effect too – on the execution time of codes. An iOS app developer will have to be prepared to spend more time on single Swift projects than what they had to for earlier Objective-C ones. Many mobile app agencies work under challenging client deadlines, and they might just be reluctant to move to a ‘slower’ language.
- Cocoa and Cocoa Touch are still in Objective C – In a year or so, most mobile app companies will start using Swift full-fledgedly. Till now though, all the essential frameworks for iOS app development, including Cocoa and Cocoa Touch, is written only in Objective-C. As a result, working with Swift only is virtually impossible, and Obj-C has to be included (that’s precisely why Apple made the two languages interoperable). For making functional iPhone/iPad apps, these frameworks are necessary, and you will have to use Obj.-C for that.
- Portability from Objective-C – This is an issue exclusively for new developers, who are not yet sufficiently familiar with Objective-C. Since they do not quite know the older language thoroughly yet – it would be extremely difficult for them to port code snippets/full programs from Obj-C to Swift. Once again, as online tutorial support for Swift grows stronger, portability will become less of a problem for newbies.
- Will all experienced developers take the plunge? – It’s one thing to show enthusiasm about a new language – and it is an entirely different thing to arrange for Swift training sessions (which involve time and monetary expenses) for mobile application developers. There are hundreds of established companies who have been doing good with their Objective-C projects for close to a decade – and initially, they might feel shifting to Swift is not really necessary.
All things said, it would be a big folly if anyone in the iOS app development business feels that learning Swift is not worth it. Swift is definitely the future for developers, and all the points highlighted above are likely to be resolved over time. All that we have emphasized is, Swift is not ready to become the only necessary language for iOS developers. Sometime in future maybe, but not just yet.
Latest posts by Hussain Fakhruddin (see all)
- Is Your ‘Great’ App Failing? These Might Be The Reasons! - April 25, 2019
- The Rise & Rise Of The Popularity Of React Native - April 18, 2019
- The Rise Of Empathetic Technology: All You Need To Know - April 15, 2019