Apple’s new programming language Swift implies that it’s fast to adopt, but it may be a slow endeavor for new programmers.
Apple announced Swift, its very own programming language that builds upon and simplifies Objective-C for its own developer community. Apple named the programming language “swift for a reason”: it allows developers who are already well-versed in Objective-C to avoid coding mistakes when typing, which, in turn, will speed up the creation of the app and its entrance into Apple’s walled garden in the App Store. For example, typing “INT” next to “STRING” will result in the Swift compiler flagging this as an error that alerts you right away. Swift has been referred to as “a new dialect of Objective-C,” and you can even mix and match Objective-C and Swift code in the same app, if you’re a developer that enjoys having a little fun with code programming.
One other benefit to Swift is that it provides feedback for developers in the projects they’re working on. In other words, with code programming comes room for error, and project feedback can help reduce programming errors and app crashes later on, when the app is made available for download. Apple just added Playgrounds to its Xcode 6, allowing developers to have a “play ground” for their app to see if the written code does what they want it to do before leaving the Integrated or Interactive Development Environment (or IDE). IDE is, to simplify terms, a sort of simulated environment where developers can modify their application in real-time and see whether or not the application does what the developer intends for it to do. Providing this kind of “app preview” for developers is certainly an excellent addition that will, no doubt, keep developers content and happy with OS X and iOS.
Alongside of Swift, Apple introduced its new CloudKit that is designed to eliminate the need for developers to write server-side application logic. CloudKit will allow developers to focus on apps and leave the security work to Apple.
It’s only been a few days since Apple’s Swift announcement at WWDC 2014, but social media giant Facebook has wasted little time in adding Swift support to its backend service, Parse. Parse’s Fosco Marroto praised Apple’s new programming language in a recent blog post: “Here at Parse, we’re really excited about Swift, because it brings a whole host of new language features to iOS and OS X applications. Swift’s type inference will save developers a ton of typing. And generics will reduce runtime errors by giving us strongly-typed collections.” Parse added Swift support easily, seeing that Swift also works well with Parse’s Objective-C libraries.
At the same time, however, “not so fast, Swift.” Swift also brings its share of disadvantages that should also be considered alongside of the benefits. For one, Swift is for Objective-C familiarity, so it’ll be a breeze for programmers who’ve used Objective-C and know enough about the basics of Objective-C to start programming code immediately. For new developers, however, Swift will be nothing short of hair-tearing. First, there’re few tutorials and little literature out at the moment to help new developers using Swift for the first time.
The goal of Swift is to reduce long, complex codes, but it’s no different than simplifying sentences in any given language: those who are familiar with any worldwide language, will know how to reduce sentences to their bare parts, but someone learning the language for the first time will have to stick to long sentences and learn proper sentence structure before simplifying his or her sentences later on. Swift is “swift” – but only for Objective-C veterans. That’s not a bad thing, but what it means is that new developers shouldn’t throw away their Objective-C textbooks just yet.
Swift makes things easier for OS X and iOS developers while keeping developers within Apple’s own app ecosystem. While Swift is designed to make programming easier, it is a solo-platform endeavor – meaning that there’s no room for Android or Windows developers in Swift. Those who use Swift will do so for Mac OS and iOS apps, not those of other platforms. If you’re a cross-platform developer who looks to design apps for multiple platforms, you may not be willing to try Swift when some other cross-platform tool such as Xamarin will work for all your apps on all your intended platforms. While Apple’s opened up its app ecosystem to third-party developers, Apple’s OSX and iOS are the chief priorities.
Finally, when it comes to being “Swift,” Apple’s new programming language has another disadvantage: its execution is slower than Objective-C. For all the modern syntax, simplified code construction, playground app simulation and testing, and type safety that you get, you also get somewhat slower execution speed. Apple may have something going for Swift by maintaining Objective-C compatibility with the new programming language, seeing that new developers will likely rely on Objective-C until they learn it – and even old developers will rely on it to help execution time.
Swift is swift – but for veteran developers. For others who are just joining the developer community, Apple’s Swift will take some time. And, for Apple, its new programming language has great potential for the future, but it’ll have to “crawl before it walks” and “run before it flies” with developers. As has been said in the legendary story of the tortoise and the hare, however, “slow and steady wins the race.”