Apple’s New Free Programming Language – Apple Swift is set to make iOS App development easier than ever. Apple announced a totally new programming language known as SWIFT, for Cocoa and Cocoa Touch, at WWDC 2014.
It is a big deal for Apple as they launched a new programming language after a long break of approx. 17 years. Claims are been made that it is dominating the iOS devices and MAC OS X programming world – already.
The article is an effort to answer some of the initial questions such as:
What is Apple’s Swift Programming Language?
Or What are the key features of Apple’s Swift language? Or What should I know about Apple’s Swift programming language?
Apple has been harping on the advantages SWIFT has over Objective-C code. But I am strongly of the opinion that the language is relatively new and hence we should wait and watch what it has for the developers. However; let’s check out on some of the reasons that are making rounds as to why Apple’s Swift is a better programming language if compared to Objective-C:
Basically, SWIFT is designed to be a programming language that can be conveniently read and coded. May be that is the reason why it does not need semi-colons at the end of each line and at the same time the functions are much easier to understand.
Humble Print command is NSLOG in Objective-C; in Swift that command is a far more familiar ‘println’. Very less symbols required to code while SWIFT is much more efficient than Objective-C.
Here is an example of how to write “Good Morning” program on the screen in Objective-C and Swift. Apple’s new SWIFT is simpler compared to Objective-C.
Objective-C: Good Morning
#import #import <Foundation/Foundation.h> int main(void) { NSLog(@"Good, Morning!\n"); return 0; }
Apple Swift: Good Morning
Here is how the Good, Morning program looks in Swift:
println("Good, Morning!")
SWIFT proves to be much simpler and so cleaner to read and learn as well. Few of the features that Apple portrays as important for confirming that the code is expressive:
One of the most prominent advantages Apple Swift boasts of is about managing memory allocation – which is no more a headache for the developers. SWIFT privileges developers and programmers with initialized variables before use, arrays and integers that are to be checked for overflow while the memory is destined to be managed automatically. This in turn makes SWIFT language safer to use for developers who arefreshers or inexperienced. Managed memory of Apple Swift makes apps more reliable for developers and non- developers, both.
As I mentioned in the opening paragraph, SWIFT is a part and parcel of the Xcode 6 IDE – Integrated Development Environment. Xcode 6 is likely to get release on the App Stores for free along with Mac OS X 10.10 Yosemite in the autumn. Meanwhile if you are amongst those registered Apple developers or iOS or Mac OS X developer; and paying £69 per year, you may get the Xcode 6 beta from Apple Developer Connection.
Or Is Apple’s Swift programming language better than Python, as Apple claims?
Being candid, I would say that Apple has successfully sold or oversold the speed of Swift by comparing it with Python. The real brain storming would have been a comparison between Objective-C and Swift. No one writes mobile apps in Python…what say? Anyways, Apple never made a pure value claim that Swift is better than Python, they were just trying to portray how fast Swift is against competitors. Swift is better than Python in so many ways and dissimilar/not as good as Python in some others. If compared on yardsticks of cross platform compatibility, third party libs, availability of developers and, simplicity of language Python definitely might have a cutting edge over Swift.
You all would agree that most of the comparisons of programming languages are very subjective as for different situations, a programming language could sweep you from the ground and for some it may even outshine another – remarkably.
It is likely that many of you would now have this question in mind. The trend suggests that developers are now inclined towards SWIFT as they find it to be a great programming language. Swift resembles a lot to Python, one of the highly regarded programming languages. SWIFT might prove to be a easier programming language for new comers, if compared to Objective-C.
Python is used regularly for programming classes and hence a lot of programmers are supposed to be familiar with a lot of Apple Swift Syntax.
Established and tenured developers also find the cleaner syntax convenient to use. So if you have already invested your precious time in gaining familiarity with Objective-C, you are likely to find lot of virtues about Swift that can make your life easy. Also not to forget, for current developers planning to move to a new programming language certainly means, learning new code, which might prove to be a distraction to your ongoing programming activities. But general consensus from developers suggests that SWIFT coding has the potential to pay off seasoned Objective-C developers.
SWIFT, or for that matter Apple, nowhere made a statement that it will be easier to move code from iOS and Mac OS X to other platforms, alike Android. There are a lot of developers busy articulating the benefits of swift development against further lock-in to Apple environment. Apple is supporting both Objective-C and Swift code for building Cocoa and Cocoa Touch apps, but no one knows till when? We eventually hope that it moves everything over to Swift.
One should be aware of iOS as Its APIs, terminology, Xcode, and many more that are mandatory for you to know about; irrespective of the programming language you select. It is really difficult to answer these particular questions – precisely!
Some developers are of the opinion to learn Objective-C first, as:
Some developers are of the opinion to learn Apple’s Swift first, as:
To add up, I would say that programming languages are just a part for the equation. The next step in it is to learn all the frameworks in the iOS SDK, responsible for providing similar APIs – irrespective of the app you end up using or mastering.A lot of controversial things said, heard and overheard.
I have tried and incorporated anything and everything here, however; feel free to comment and share your views and opinions – if I missed out on any of the points!