July 9, 2015
Filling the minds across the IT industry, Swift seems to be constantly on the community members’ lips. Some admire its simplicity and conciseness, some blame it for being raw or incomplete, while others even claim that Swift’s functionality isn’t worth that much attention, and the surge of delight around its current release is no more than a massive marketing campaign, which Apple forked out quite a bit of money for.
Thus, we made up our minds to put together our expertise in programming on Swift and other languages with observations, briefs and extensive reviews we studied — both laudatory and denouncing, tracking the most significant features and functional similarities.
Out of Whose Ribs?
Any new language stems from a number of its predecessors, and Swift is not an exception. One of its greatest advantages is that Swift creators were obviously struggling to make their brainchild a refined and polished embodiment of the best features of the existing programming languages. So, what is there in common between Swift and its elder brothers?
C# and Java
Quite a number ofSwift’s functional elementscome from languages like C# and Java:protocols seem to be of the same breed with interfaces. Integers — signed and unsigned, and data structure declarations are no inventions as well.
Scala and Opa
A smart way to avoid bringing “handmade” bugs into one’s code while typing is to employ type inference as a perfect tool saving time for annotating variables.
Cold Fusion, JSP & co
Interminable wrestling with string templating often turns into a nightmare for the painful necessity to use rather monstrous constructions while comparing and binding strings. Following the example of several other languages, Swift gives a free hand in using simple “+” and “=” characters in all statements, switch ones included.
Lisp, Lua, and Python
Just like in the abovementioned languages, tuples in Swift offergrouping elements into compound variables or vice versa — cutting compounds into separate constants or variables, irrespective of what the values type in a tuple is, and approaching them by 0-starting index numbers.
Swift’s Generics resemble Templates in C++, as both are reusable with different variables, and do not require rewriting each type.
Both Objective-C and Swift featureanautomatic reference counting, that we also know as a native garbage collection in C# and Java. Swift also employs closures, which are much alike Objective-C’s blocks. Above all, Swift and Objective-C’s code bases are interoperable, which enables matching them while converting apps or building new ones.
Perhaps the most exciting tool offered by Swift is its Playground, which is an interactive environment where the result of code changes can be seen immediately just as one types. The playground itself comes saved as a separate file, and the number of playgrounds one can build is unlimited. The tool sets a programmer free of an Xcode project creation serving as a simple console-like testing instrument. The playground also provides an opportunity to check the value of a variable through a side bar.
Sweat for Swift
Even though the developers who already code in Swift noticed that the transition wasn’t that painful, some of them admitted the process of converting the language into a computer-readable format being too power-consuming even for Macbook Pro laptops.
The Advantage of Being the Last
Yet, while new features keep being added, developers prefer to take their time before falling into large projects employing Swift. At the same time, customers seeking iOS development skills show a lively interest in Swift projects, driven by the idea that they would be among the priority ones getting the green light or extra support.
Well, how are you getting on with Swift?