How the latest Programming Language is going to change the world, cure cancer, and maybe look good on your resume.
1 year ago I would have never guessed that I could get so excited about a new programming language
There has been a lot of hype surrounding Swift, Apple’s latest Programming Language. But what really is Swift? Is it webscale? Is it fun? Is it worth 20% equity? To all these questions I answer with a resounding…maybe!
A brief history of programming languages
Apple started out as a fruit, but rebranded itself as a popular software company somewhere around the late 1970s. During this time, it began to popularize Objective-C, a Programming Language used on iPhones to this day.
While Objective-C is a good Programming Language (P.L.), it is by no means the first. As programmers, we build off the work of those before us, and Objective-C is no different. Precursors to this popular P.L. include SmallTalk (with an I.D.E.), Cobol (the language that introduced structs, records, and the incandescent lightbulb), and Subjective-C (a language that never really took off due to each compilers interpreting it differently).
Now that we are in the Future (2014), we can no longer rely on Objective-C, no matter how good of a P.L. it is.
Swift written in XCode, Apple’s popular open-source video editor
Swift (named for the popular country singer of the same name) is, much like its namesake, both attractive and based on a functional programming style.
But what does this all mean? Here is a brief rundown of Swift’s most exciting features:
Writing code is hard, and the kind folks at Apple understand. It’s like you’re just writing the same thing over and over again. Generics let you specify details about your programs later, such as “what return type is it,” “how many arguments does it have,” and “what’s its Social Security Number.” Be warned, though, that not all programs are obligated to answer these questions unless you ask nicely.
2. Type Inference
In an effort to emulate modern human speech as closely as possible, Swift includes this exciting feature to make sure that you never mean what you say and never say what you mean. Why say the whole truth when people can just infer it?
3. Multiple Return Types
Multiple Return Types, or M.R.T., is Swift’s way of letting you have your cake and eat it too. Other Programming Languages only let you return one thing. Returning more things is clearly better!
Sometimes you want to use the same name as someone else. I, personally run into this problem a lot. Damn you, mysterious owner of jameswu.com. Why are there so many James Wus in the world? Why do I have such a generic name? I think namespaces fix that. Maybe.
Last, but not least, are closures, my personal favorite feature of Swift. In most modern code, everything is open and out there. How lewd! Closures keep your code local and secure—invisible to the N.S.A. You can package functions up nicely like little presents and give them to other functions! It’s quite literally the gift that keeps on giving, and if you don’t like them you should probably reconsider your life choices, Scrooge.
Swift is the future and I am now hiring
programmers web SEO ninja jedis with 5+ years experience in it. Applications are open, and I guarantee you 20% equity. Line forms to my left.