Apple's Swift Programming Language: 10 Fascinating Facts
Swift 2.0 is Apple's main language used for programming OS X and iOS systems. Here are 10 things you should know about Swift before you dive in.
![](https://eu-images.contentstack.com/v3/assets/blt69509c9116440be8/blt876e8dc1b665d8af/64cb3d4b49a320e1e20ae772/Swift_logo.png?width=700&auto=webp&quality=80&disable=upscale)
With new Apple products around the corner, enterprise developers and commercial programmers alike are looking at how to move new applications onto Apple's Mac OS X and iOS platforms.
There are a bunch of options, but if you want to do it the Official Apple Way you're going to use Swift.
Swift was introduced at Apple's Worldwide Developer Conference (WWDC) 2014 as a replacement for Objective C, Apple's long-time programming language. At WWDC 2015, Swift 2.0 was announced with a number of improvements and changes, including Apple's commitment to make Swift an open source language. It's too soon to know precisely how an open source future will effect Swift 2.0, but the ability to use Swift for Linux (as promised by Apple) and, perhaps, Windows systems can't hurt the language's popularity.
[What to learn more about mobile programming languages? Here's InformationWeek's list of the best ones.]
How much should you care about Swift? Well, that depends on how much your plans involve applications for Apple platforms. If they are part of your plan, then you'll want to know some facts about the language, and we're here to help.
How does Swift stack up against other platform-specialized languages, like C#? Much of the answer depends on your needs and your taste in programming tools. Take a look at these Swift facts and let us know what you think: Could Swift become one of the major languages used around the computer industry, or will it forever be tied to Apple? And if you're currently using Swift we'd love to hear from you. What interesting facts did we miss? We'll look forward to the discussion in the comments section below.
Swift is built on an Objective C foundation. That's easy to understand, since Swift was preceded by Objective C, and critical for keeping legions of Apple developers from going into open and complete revolt.
Even if the reason for sticking with the Objective C syntactical basis is financial, developers reap the benefit. C is perhaps the world's most widely used language, Objective C builds in an object-oriented direction, and Swift keeps climbing. If you hopped on the trail at any point, you can keep moving toward Swift with little resistance.
The best news stemming from this is that you don't have to "un-learn" anything in order to start making sense of Swift. With new Apple hardware around the corner, that's great news for developers who need to have apps up and running ASAP.
Swift has a "playground" that allows programmers to instantly see the result of code without going through the complete compile/link cycle. All you need is a web browser.
A Swift playground is a document where Swift code is compiled and run on a live, interactive basis. As you type, results are displayed in a step-by-step timeline as they execute. You can also see and inspect the contents of variables at every point in the execution.
Here's where things get interesting: Playgrounds can be created within an existing programming project, or as standalone documents. That means they're good for figuring out how your code is working, and for teaching others how code works -- or, really, developing any number of simple interactive applications.
Don't think that these playgrounds are only for fun. There's some serious business that can happen here.
Among the news that came from WWDC 2015 was an announcement that Apple would be releasing Swift 2.0 as an open source language. The company announced that it will release versions of the language for OS X, iOS, and Linux by the end of 2015. It's logical to assume that versions for Windows and Android will come from the open source community some time in 2016.
Aside from the possibility of Swift as a language useful on a variety of platforms, why should you care about this? The big reason is that the creativity of an entire community can be unleashed on developing and debugging language features. This means that Swift will no longer only be about what makes the most sense for Apple. It will be about what makes the most sense for the Swift community. And that is, almost certainly, a very good thing.
Since Swift walks the path blazed by Objective C, it stands to reason that Objective C and Swift modules can be mixed in a single application, and that's precisely what many developers are doing. There are several major advantages to the mixed approach.
One of the advantages is that you can learn Swift at your own pace, sticking to the more familiar Objective C for functions and modules that might tax your knowledge at an early stage. Another advantage is that functional modules developed in Objective C can be used in Swift applications. There's no need to go back and re-invent the Objective C wheel when you move to Swift.
Swift is the present and future of developing applications for Apple platforms. That doesn't mean you have to sprint into using the language, though. Slow and steady could be a winning strategy for you where Swift is concerned.
If you're like many developers, you can remember writing a program, compiling and linking the code, then working hard to figure out why it didn't work. Swift still uses the compile/link development cycle, but there are key features to the language that make it much better than most languages as a learning tool.
We've already talked about the Swift sandbox and its role in prototyping. Those same qualities make it a superb learning environment for programmers in training. In addition, sandboxes can easily be developed to help programmers learn specific lessons on the language and its use.
Even without the sandbox, Swift has the ability to give programmers useful feedback as they're writing code, rather than forcing them to wait until compile time to figure out issues. That alone will make many budding developers take a look at the language.
Swift's development has moved quickly, from initial announcement to version 2.0 in one year. The rapid pace of development means that enhancements (and problems) have come rapidly. Many of the problems have revolved around performance issues or third-party libraries that haven't kept up with the revisions to the language and the related IDE.
If you want to develop applications for the Mac, iPad, iPhone, iPod, or Apple Watch, then Swift (and Xcode) is where you'll be spending most of your time. The good news is that you can learn one syntax and write apps for a wide variety of platforms. The bad news is if you hate using Swift for one platform, you're going to hate using Swift for everything that Apple makes.
Remember the open source statement a few slides back? Well, at the moment that's somewhere between a statement of intent and a work in progress. Apple has said that it will release Swift 2.0 for OS X, iOS, and Linux. Now, pay attention. The company hasn't said it will release Xcode for all those platforms. The language itself (with its attendant libraries) will be out for Linux by the end of 2015, though. What about Windows? Well, it's a possibility, especially for compiler geeks. It will probably happen, but likely not before sometime late in 2016.
-
About the Author(s)
You May Also Like