Swift Overview

Swift overviewSwift is a new programming language built using a modern approach to safety, performance, and software design patterns. Apple developed Swift based on the structure of C and Objective-C, without the constraints of C compatibility. Because of its simplicity, adoption of safe programming patterns, and it’s addition of modern programming language features Swift is simple and flexible for programmers. In addition, Swift uses a compiler optimized for performance and optimized the language for development, without compromising on either.

From swift.org:

The goal of the Swift project is to create the best available language for uses ranging from systems programming to mobile and desktop apps, scaling up to cloud services. Most importantly, Swift is designed to make writing and maintaining correct programs easier for the developer. To achieve this goal, it’s believed that the most obvious way to write Swift code must also be:

Safe. The most obvious way to write code should also behave in a safe manner. Undefined behavior is the enemy of safety, and developer mistakes should be caught before software is in production. Opting for safety sometimes means Swift will feel strict, but we believe that clarity saves time in the long run.

Fast. Swift is intended as a replacement for C-based languages (C, C++, and Objective-C). As such, Swift must be comparable to those languages in performance for most tasks. Performance must also be predictable and consistent, not just fast in short bursts that require clean-up later. There are lots of languages with novel features — being fast is rare.

Expressive. Swift benefits from decades of advancement in computer science to offer syntax that is a joy to use, with modern features developers expect. But Swift is never done. We will monitor language advancements and embrace what works, continually evolving to make Swift even better.


The features included in Swift make code easier to read and write and at the same time giving the developer the necessary control. It uses familiar dot-notation syntax for making method calls. The namespace system used by Swift is also similar to other common object-oriented languages. Swift introduced named parameters which help easily state the name of parameters for function calls. In addition, Swift also includes concepts like protocols, closures, and categories similar to Objective-C except with cleaner syntax.

Swift also does not expose pointers and other unsafe accessors. To make code cleaner and less prone to mistakes, Swift supports inferred types and has no requirement to use semi-colons to end code statements. Designed to work together, Swift features create a language that is powerful, yet fun to use. Some additional features of Swift include:

  • Syntactic sugar
  • Closures unified with function pointers
  • Tuples and multiple return values
  • Value types
  • Generics
  • Fast and concise iteration over a range or collection
  • Structs that support methods, extensions, and protocols
  • Functional programming patterns, e.g., map and filter
  • Powerful error handling built-in
  • Advanced control flow with do, guard, defer, and repeat keywords


From the beginning, Apple designed Swift to be safer than C-based languages. The syntax makes it easier to define your intent because of the tuning. A prime example is the keywords that define a variable (var) and a constant (let). Swift has automatic memory management, a requirement for the developer to initialize variables before use, and arrays and integers checked for overflow.

Another safety feature of Swift is that Swift objects can never be nil. Trying to make or use a nil object will result in a compile-time error. This makes writing code much cleaner and safer while preventing a common cause of runtime crashes. When you have a legitimate case where nil is appropriate Swift has added a new feature called optionals. Optionals can contain nil, but you have to use the ? syntax to indicate that you expect this behavior.

More about Swift

Swift is an exciting new programming language with many possibilities. This is was just a Swift overview, but there is so much more to learn. To help you learn Swift look for tutorials, sample code, and community forums to get you started.

Trackbacks & Pings

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: