Apple’s Swift Playgrounds - Game teaches children to code

Kamikaze Revy

Bwana ni mwokozi wangu
Supporter
Joined
Sep 4, 2012
Messages
29,959
Reputation
9,480
Daps
76,855
Reppin
Outer Heaven
Swift-Playgrounds-coding-640x481.jpg
[URL='http://cdn.arstechnica.net/wp-content/uploads/2016/07/IMG_0002-2-980x735.jpg'] [URL='http://cdn.arstechnica.net/wp-content/uploads/2016/07/IMG_0019-980x735.jpg'] [/URL][/URL]

The real meat of Swift Playgrounds right now is all in Lesson One, which takes the gamification approach to teaching. The right side of the app is a simple game in which a blobby alien named Byte trundles around an isometric 3D map collecting gems and activating switches. The left side is effectively the game’s “controller,” but instead of buttons or swipes you type in code. And while you can use Swift Playgrounds entirely with the keyboard if you want, Apple has done a lot to make coding less laborious on a touchscreen device.

"It’s an environment designed for touch," Wiley Hodges, Apple's Director of Tools and Technologies Product Marketing, told Ars. "You actually touch code, you actually interact with code. When you’re using 'a' for loop, you’re dragging the loop around the code that is inside it. You get a unique iPad coding experience."

The app is probably best used with an actual physical keyboard, whether it’s a Smart Keyboard cover or something paired via Bluetooth, but Apple has made a few tweaks to the standard iOS software keyboard to make it more code-friendly. Every key has one or two alternate characters that you swipe to type. Swipe the keys in different directions to type with these alternate characters—swipe down from the top or diagonally from the upper-left and right corners depending on where the character is, and you’ll type it without having to go to the Shift key.

By far the most useful text-input features are the suggestions that pop up above the keyboard (or at the bottom of the screen if you have a physical keyboard attached). These suggestions, which unlike standard typing suggestions can be scrolled through horizontally to uncover more, let you quickly and easily tap out certain commands and functions so that you don’t need to worry about repeatedly typing them.

This is especially helpful early on when you’re learning how to code things, but you haven’t yet been instructed on the nuances of Swift’s syntax; some things have parentheses and braces before or after or surrounding them, but you’re not told why right off the bat. A “code library” of keywords like “let” and “for” and “while” and “func” provides an easy reference for a little later on when you’re creating your own code rather than editing existing code, and you can tap and drag any of these keywords to drop them right where you want them. This also applies when you’re debugging and need to move things around or when you’re expanding braces to encompass more lines of code—you can copy and paste like you normally might, but you can also tap and drag.

Finally, Apple includes a series of tools to make referencing basic information and sharing your coding efforts relatively easy. There’s a glossary of terms available for when you need to look things up and options to record movies or (with the help of compatible third-party apps) broadcast live, which could be especially useful for remote classrooms or sharing one student or teacher’s efforts with the rest of the class.

Swift Playgrounds is also meant to give coders full access to the hardware—all the sensors and camera hardware are available to use, and you can even connect to external accessories through Bluetooth. You can't make App Store apps with it, but you can use it to do a lot of the same things a "real" app would be able to do.
 
Top