HE LOOKS LIKE a Minion, one of those yellow, cycloptic creatures from Despicable Me, except he’s brown and pear-shaped. And he wears what appears to be fanny pack.
So, really, he looks more like a middle-aged, middle American Minion who spends too much time in the sun. And right now, he’s on my iPad, ambling across an airborne tropical island in search of spinning, sparkling, levitating red rhinestones. His name is Byte, and I have to say: he’s a rather endearing little cartoon. Plus, I can control him with software code.
With one-line commands or nested functions or while loops or conditional code or logical operators, I can make him to walk, leap, turn around, flip a switch, and all sorts of other stuff. And if none of that means anything to you, well, you’re in luck. Byte is here to teach you.
This is the new Swift Playgrounds app, the next step on Apple’s path towards a new breed of computer programming. If you’re not a coder, that may seem a tad esoteric. But you’re the app’s target audience, along with everyone else. With Playgrounds, Apple pretty much wants to turn us all into coders. And considering the code-centric way the world is moving, that’s not such a bad idea.
Two years ago, Apple unveiled a programming language called Swift. Like various other languages created over the last several years, Swift aimed to simplify and streamline the art of coding without sacrificing the speed and power needed to build apps and online services in the modern world. Part of this push was a tool called Playgrounds, which until now only ran on laptops and desktops. It gave Apple coders a new way of looking at code. As they wrote their code on one half of the screen, they could watch it execute on the other.
That’s not exactly a new thing. Other tools operate in similar ways, including IPython (aka Jupyter) and Mathematica. But this is Apple, the company that makes the iPhone and the iPad. It has a certain out-sized influence over the rest of the computing world. According to some estimates, Swift is already one of the world’s most popular languages—mainly because it’s a way of building stuff for the wildly popular iPhone and iPad. Now, with the new Playgrounds iPad app, Apple is hoping to push the language into the hands of everyone, including your kids.
“Swift is not just a thing that pro developers can use,” says Wiley Hodges, an Apple product marketing manager that helps oversee Swift and Playgrounds. “It could be someone’s first programming languages
Due to arrive in the App Store this fall, the app is an educational tool. Through Boris and his levitating rhinestones, it teaches the fundamental concepts of programming, from commands and functions to loops and algorithms to variables and types. Other tools do similar things, including a seminal language for kids called Scratch. But Playgrounds teaches you to program not just through visual metaphors but with real code.
Minutes after launching the app, you can learn to string together a few commands. Then you can watch them execute. You can move Byte forward with a simple “moveforward ()” command. You can pack three “turnleft ()” commands into a function and use that to turn him right. You could move him up and down and across the floating island with several nested functions. Playgrounds teaches real problem solving without skimping on the syntax. It shows you what it means to “debug” a program, to find and remove mistakes. This problem-solving is so real, it can get frustrating. But that’s a good thing. As I played with the app, I got caught up in making sure that Byte behaved exactly the way I wanted him to.
The clear yet powerful lessons the app bring to the iPad are especially suited to kids, who are growing up with touchscreens, not keyboards, as their standard computing interface. Fareed Quraishi, a coder at a Swift-centric shop called Perfect, sees the app’s built in feedback loop—write program, see it run—as an ideal way of teaching programming to his young niece and nephew. “This could be used to teach almost anything,” he says.
But at the same time, this is an app that can serve experienced coders. Byte inhabits a “playground” for kids and novices. But you can also build your own playground—a place where you can see the results of any of your own code. Quraish, for instance, used the original Playgrounds to learn Swift, and he still uses it to test snippets of code as he writes, ensuring that a particular algorithm will work before pushing it into a larger application. Now that it’s on the iPad, he says, he can write and test code wherever he might be—even places unsuited to a laptop.
This is what Apple is aiming for: Swift everywhere.
Others outside the Apple universe don’t quite see this as a revolution. “Apple Swift Playgrounds is a tool for learning Apple’s Swift programming language,” says Daniel Greenfeld, a coder with Internet consultancy Cartwheel Web who specializes in a language called Python. “Nothing new, just created and maintained by Apple.”
For him, the real education won’t come from Playgrounds or any other new coding tool. “The thing that really teaches you how to code is wanting to build something,” he says.
Polishing the Apple
The Apple faithful see Playgrounds eventually evolving into a system where coders can build anything for an iPad on an iPad, where creating apps is as visual and interactive as using them. “I feel like playgrounds are hugely important for the next generation of devs,” says Matthew Palmer, an independent 21-year-old coder based in Australia. “Not just the next generation in terms of young people learning to code, but what development will actually look like in a decade.”
Umberto Raimondi, a coder based in Italy, believes Playgrounds still needs improvement. He wishes it was more like IPython. But eventually, he believes, it will help far more people become coders. That’s a grand vision. But considering how rapidly code is winding its way into every corner of daily life, via phones and tablets and watches and the Internet itself, it’s a good thing to push for. Byte is a cartoon with a fanny pack. But he’s also just what the world needs.