Dr. Mac’s Rants & Raves
Episode #399
When I was in college (a long, long time ago), computer science was in its infancy. My only exposure to computers was a single required course, Programming in Fortran. I remember it involved stacks of fussy punch cards and logical thinking. I hated it and barely passed, but it left me with a lifelong dread of coding.
Introducing Swift Playgrounds
I recently started playing with Apple’s free Swift Playgrounds for Macs and iPads, a free app that makes it (gasp) fun to learn Swift programming.
What is Swift? Apple describes it as “a robust and intuitive programming language created by Apple for building apps for the Mac, iOS/iPad OS, Apple TV, and Apple Watch.” And Swift Playgrounds is an app (for Macs or iPads) that makes it fun and easy to learn to program in Swift by teaching you to code with interactive on-screen puzzles. You solve them by arranging the proper commands in the proper order and then clicking the Run My Code button, and watching your code run in a beautiful interactive 3D pane, you can rotate and zoom as the code runs.
When you make a mistake, and you will, it’s easy to determine what went wrong, add or reorder commands, and try it again. And, if you get stuck, Playgrounds has built-in help and hints galore.
Autocomplete that Works
Something I really love is that I don’t have to keep typing the same finger-twisting command names over and over. Instead, I type the first few letters, and Swift automatically completes the command or provides a list of clickable choices.
I also like that Swift is free and open source. And while it’s still relatively new, I’m happy that many developers (LinkedIn, Lyft, Eventbrite, Kickstarter, and more), and that colleges and universities worldwide (including Houston Community College System) have embraced Swift.
The Lessons
There are nearly 100 lessons in the two Learn to Code playgrounds—Fundamentals of Swift and Beyond the Basics, plus numerous additional playgrounds to download and explore for free.
I’m intrigued by the one called Battleship, in which you develop an algorithm to hunt and target opponents’ ships most effectively. It’s beyond my current skill set, but I think it’ll make sense once I’ve completed the two Learn to Code playgrounds.
I’ve only completed a handful of lessons so far, but I’ve been enjoying them a lot more than I expected. It really is fun, and I keep coming back for more.
I don’t know if I’ll ever develop the skills to create my own Mac, iPad, iPhone, Apple Watch, or AppleTV app, but now that I’ve overcome my fear of coding, I plan to continue learning Swift programming with Swift Playgrounds.