Why Learn Swift
When you first become interested in learning how to code, it can be overwhelming when you discover how many languages are out there. This article touches on just a small portion of computer history and, in doing so, provides background on a few coding languages. It can be difficult to feel secure in your choice of a first programming language. After a basic first Google search, you will see Python, Java, Ruby, and Swift as suggested languages. There really are no wrong choices when learning, as long as you are widening your scope of understanding. This article gives some history and logic behind choosing Swift to add to your software tool belt.
Origins of Swift
Beginning with C
Like other technologies and inventions, a lot is owed to predecessors. In the world of computer science, many consider C to be one of the most powerful and important programming languages. This is because of its influence since its inception in the 1970s and 80s. As of November 2021, C still ranks #2 in the TIOBE index. C is still widely used and relevant in day-to-day life—the MacOS kernel, Windows kernel, Android kernel, and Linux kernels are all written in mostly C. C is also the closest among modern programming languages to machine language. It is still high-level enough to be relatively easy to learn. Additionally, C's syntax and
Bell Labs, Unix, & Objective-C
In the 1970s, the team at Bell Labs was seeking to create a new programming language to for the developing Unix operating system (OS). One programmer, Ken Thompson, developed the language, B, based on BCPL, a now obsolete language. Dennis Ritchie, also part of Bell Labs, created C by adding structures to B, allowing Bell Labs to write the Unix OS. The Unix kernel was written in C, and throughout the 1980s, C grew in popularity, as did the Unix operating system.
In the 1980s Objective-C was developed as a superset of C—i.e., Objective-C contains all of C's features AND has additional syntax for classes and methods. Brad Cox and Tom Love developed Objective-C in the 1980s. They were intrigued by the ideas from Smalltalk, from Alan Kay's team at Xerox, where programming was data-centered, grouping information as objects, and actions carried out on the objects would be called methods. Additionally, Smalltalk programs could execute methods in realtime and, therefore, could take user input. However, Cox and Love wanted to use a Unix system and admired how quick and efficient C's programs could be. They developed Objective-C to combine the qualities they desired from both C and Smalltalk.
NeXT, the predecessor to Apple, licensed Objective-C from Cox's and Love's company, Stepstone in the late 1980s. In 1996, NeXT bought the rights to Objective-C from Stepstone. Objective-C was further developed to meet NeXT's and then Apple's operating system needs.  Then, Apple launched Swift in 2014 to eventually replace Objective-C.
What is Swift?
Apple "Replaces" Objective-C
In 2010, Chris Lattner, a software engineer at Apple, began creating another programming language that would improve on and be able to integrate with Objective-C. In 2014 Apple introduced Swift as a syntactically smoother and safer option to eventually replace Objective-C. At the time Objective-C was the primary language for developing Apple operating systems and its apps When Lattner and Apple released Swift in June 2014, they also released Swift Playgrounds, an app that serves as an educational tool and development environment for Swift. Playgrounds allowed new users to explore Swift and enabled Apple to demonstrate how easy Swift was to pick up.
A Safe, Fast, and Modern Programming Language
When looking at Apple's official page on Swift, the language's characteristics most advertised come to the fore quickly. Apple describes Swift as "Modern...Designed for Safety...Fast and Powerful...Open Source" and easily adoptable for macOS and iOS development because of its ability to coexist with Objective-C. When explaining Swift's modernity, Apple describes clean syntax, devoid of required characters that denote the end of lines, automatic memory management, and support of emojis and various foreign languages. Regarding safety, Apple adds that all variables are always initialized before they can be used. Swift has been described as "a type-safe and memory-safe language." This means that Swift was written and designed to prevent common bugs and memory problems from occurring, without the same level of vigilance required from the programmer when using C, Objective-C, or other languages.
Reasons to Learn Swift
Open-Source (& Apple) Community
Just like Linux, Swift is an open-source software. This means that, like other open-source technologies, a variety of people—developers, product managers, companies, etc.—can troubleshoot and resolve any issues or security breaches that arise. Additionally, a community exists to help beginner coders and new Swift users acclimate and kick-start their journey with Swift. Furthermore, having the backing of a major tech company like Apple is an added benefit; it provides a community that already uses the language every day.
Apple Infrastructure & Intentions
Since Swift originated at Apple, the language was designed at the same time as accompanying tools and apps, such as an integrated developer environment (IDE), debugger, and more. Apple, on its official Swift page, writes that Swift "was designed to be anyone’s first programming language" and links to free Swift curriculum that Apple created for educators and a free student-friendly app designed to learn how to code, and how to code in Swift specifically. The app, Swift Playgrounds, mentioned earlier, is available on iPad and desktop. It lets the user write code directly in the app without needing to recompile or restart the program. The animations makes it accessible to students of all ages. The goal-oriented nature of the app makes it engaging for adult users too. Playgrounds illustrates how fast a language Swift is, outpacing Objective-C greatly.
The ubiquity of the iPhone, iPad, and Apple's products creates an immediate incentive for companies to provide Apple-friendly mobile versions of any applications they run. This, in turn, creates the need for developers who can create mobile apps using Objective-C, and now using Swift as well. Building an iPhone app can also be a great way to begin a portfolio as a student applying to colleges or internships.
Get Started Learning Swift
Coder Merlin is provided to promote accessible quality Computer Science education for students, primarily in high school. As such, starting students with a beginner-friendly, open-source programming language like Swift aligns with the mission and vision of the wiki. Much like the Linux OS that Coder Merlin uses, Swift provides students with access and practice for using an entire community of technologists beyond Coder Merlin. In addition to the free resources mentioned in this article—available through Apple—Coder Merlin also provides additional, tailored support and curriculum to help students in their journey through code. By learning with Coder Merlin, you are then gaining valuable hands-on experience with Swift, and can even develop your own macOS and iOS apps using what you learn. Whether Swift is your first, second, third, or nth language, happy learning and coding!
- What is Swift?
- Swift is a modern language developed by Apple as an improvement to Objective-C, used mainly for iOS and macOS development.
- Swift's predecessor, Objective-C, was built in the 1980s as a way to integrate object-oriented programming syntax into C.
- In turn, C was developed in the 70s in Bell Labs for the Unix operating system.
- Reasons to learn Swift
- Swift is significantly faster than its competitors.
- Swift is open-source and provides the support of an open-source community.
- Having been developed by a tech giant, like Apple, Swift also benefits from infrastructure and support from Apple throughout its development, including curriculum and other educational resources.
- Swift is used to develop iOS apps; therefore, it creates an opportunity for job skill and portfolio development.
- How to get started learning Swift
- Many free resources are available through Apple's website.
- Anyone with an iPad or Mac can download the Swift Playgrounds app and get started coding Swift immediately.
- Using Coder Merlin to learn Swift, Linux, and other software concepts is another free and easy way to kick-start coding.
- "'A damn stupid thing to do'—the origins of C." (Ars Technica 2020) Accessed on November 23, 2021.
- "TIOBE Index for November 2021." Accessed November 23, 2021.
- "After All These Years, the World is Still Powered by C Programming." (TopTal Developers) Accessed November 23, 2021.
- "Difference between C and Objective-C." (Geeks for Geeks) Accessed November 23, 2021.
- "The Development of the C Language." (Ritchie, Dennis 1993). Accessed November 23, 2021.
- "A Short History of Objective-C." (Hu, Hansen 2017) Core Magazine. Accessed November 23, 2021.
- "Apple Launches Swift, A New Programming Language For Writing iOS And OS X Apps." (TechCrunch 2014) Accessed November 23, 2021.
- "Why Apple's Swift Language Will Instantly Remake Computer Programming." (WIRED 2014) Accessed on November 23, 2021.
- "Swift." (Apple) Accessed November 24, 2021.
- "Swift vs Objective-C: Out with the Old, In with the New." (Altexsoft 2018) Accessed November 24, 2021.