Playgrounds Are for Kids

Swift Playgrounds are a great place for experienced developers to easily experiment, but they hold much greater promise. In this talk, Daniel Steinberg draws on his own history of programming education, presenting a moving narrative that explores what Playgrounds could mean for the education of our children, and those who have never programmed before.

With live demonstrations, we learn about the evolution of teaching technology, from BASIC to Logo’s Turtle, Squeak and Scratch. Developing the lineage, Daniel adds his own: an open source Turtle Playground for teaching Swift to kids. Recommending a “fun-down approach” to learning, we end on a call to build and share our own teaching tools, and help raise the programmers of the future.


The Big Here (0:00)

The desktop wallpaper of Yosemite National Park greeted us on our screens last year. Earlier this year at CocoaConf, we got to go to Yosemite and look around. One of our attendees took a picture of the Yosemite valley. The picture is a way of placing yourself in what Stewart Brand called “the Big Here” — you feel your place in the world, and you think you should do something more important, and more permanent. You look at these stunning mountains that have been around for a long time, and realize that a lot of what we do doesn’t stay around.

I like just about everything that Mike Hay says in this tweet. He sits there and watches this incredible phenomenon, on a wireless screen that sits in his hand. And, my favorite part: it wasn’t important enough for him to stop eating breakfast. The things we see that are astounding, that are now everyday.

The first picture I ever had of my daughter was from when she was four months old: 👶. We were waiting to adopt her, and my sister-in-law called me up and said, “Is she cute?” And I said, “She will be.” I look at her now, as a freshman in college: 🙋. The transformation over time gives us what Stewart refers to as “the Long Now.” It positions ourselves in time and space. And so I want to position you a little bit in my space. [Original pictures removed per speaker request.]

Get more development news like this

The Evolution of Technology in Teaching Programming (1:56)

10 PRINT "Hello"

Here’s the first line of code that I ever wrote. And I want to stress how old I am: I’m so old that they hadn’t invented “Hello World!” yet. We just printed hello in those days. The second line of code I wrote, of course, was this:

10 PRINT "Hello"
20 GOTO 10

There was a program that we wrote in BASIC. Of course, somebody in class figured out if you make a small change, you can ring a bell. And someone else reasoned that if you use GOTO on it, you drive your teacher crazy:

10 PRINT CHR$(7)
20 GOTO 10

This, of course, is the origin of the famous conclusion that GOTOs are dangerous.

The first machine that I typed code on was a huge, person-height keyboard. We had one in our classroom. One in our classroom meant that most of us spent our time doing flowcharts, preparing our programs, and getting things right because time on this machine was very precious. Now young people may not realize, despite how it looks, that machine is not a computer. It had no intelligence at all. We were communicating with the Xerox Sigma 9 computer. Our computer was the size of a room, and we communicated from our high school to this computer using another machine, which used a telephone. The Xerox Sigma 9 shipped standard with this technician and maintainer, who is looking off to the side in the picture because he sees the future; if you look carefully, you can see an Apple Watch on his wrist.

If you think back to those times where we used a terminal, and the computer was remote, and our time on it was precious, it’s amazing that the kids in our lives now, even though they may not own a watch or an iPhone, get to grow up in a world where these exist. And, in my opinion, one of the most exciting announcements that Apple made at WWDC this year was that anybody who is 13 years or older can push apps to a device for free — a big change in our world. If you remember the first time you wrote the dumbest app in the world, and you ran it on your device, it felt different; interacting with a button on a phone feels different than in a simulator.

Interactive Programming Education Tools in the Past - the Turtle, Squeak, and Scratch (4:20)

When I taught in high school, we were taught on old, inaccessible computers. We were doing things like printing move commands for a turtle because computing wasn’t a separate department, but part of a math class. We were doing Turtle Logo and telling the turtle to move around with commands like this: forward 100, turn right 90, go forward 100.

This was the work largely of Seymour Papert, an amazing man who saw the future. In front of him is a mechanical turtle. This was the original turtle, it had a pen that would lift up and down, and it would draw things on paper.

Those of us on the Mac owe an awful lot to Alan Kay, who also spent time at the Media Lab, much as Papert had. So much of what we have on the Mac derives from visions that he had many years ago. But one of the things I want to call out is his work with an environment, and a programming language, called Squeak. He looked at Squeak as a way of getting kids to interact with real objects that you could draw. It allowed you to draw an object and then give it behaviors.

Squeak: Demo (5:31)

To draw objects that can behave, for example, I’m going to use Squeak to paint a car. We start by drawing something, then, we give it behavior. I think this is pretty deep, we just draw something, and then we teach it how to do things. We end up with a functioning car, which I think is a lot more exciting. [Demonstration continues]

The kids learning Squeak are programming. They’re programming with objects. This is pretty wonderful, except for the observation: perhaps kids don’t have patience for this anymore, perhaps kids don’t want to mess with this environment, and read a lot to make it function.

Scratch: Demo (9:25)

After Squeak, people came up with a modernization of Squeak called Scratch. At one time Scratch was downloadable and ran in its own environment like Squeak. But instead, they thought it would be a better idea to make it work in browsers. Upsettingly, Scratch required Flash, so I had to switch to Google Chrome just to view the site.

As much fun as Scratch is, we always get to a point with kids where they do really interesting things, but then they say, “Now what?” It doesn’t teach them to do real programming, and that’s not a knock on Scratch, but we’re in an artificial environment. And although we are teaching them the logic and the reasoning of programming, what happens when they want to write an iPhone app or a Mac app, something that they can give to their friends? These are fun for a while, but at some point, they realize that you can spend all your time in miniature golf, and you’re never going to become Tiger Woods.

The Future of Programming Education - The Fun Down Approach (11:41)

Ask what we’re teaching, what our goals are. For me, my goals are to teach kids to actually program, to teach them to use Swift, to use Xcode to write real programs. And not just to write programs, but going back to I don’t know what it was in that high school classroom that got me to love it, but to teach them to love it as well. Jeff Biggus has this wonderful expression of taking a “Fun Down Approach.” Start with something fun, and they will dig further down and do the harder stuff, they’ll peek and poke into memory and so on (thank you for that phrase Jeff!).

There are pedagogical issues you run into when you have theory versus reality. As a former math teacher, I am experienced in how students learn and the steps they must take to comprehend a new topic. For instance, multiplication is commutative, and yet initially kids don’t understand that. 1 x 6 ≠ 6 x 1 from a conceptual perspective to kids. Just the fact that we think they’re the same doesn’t make it so for them. As we go into teaching kids to program, we have to be aware of these meta-issues that we’re getting at and reach them when they’re ready for that next step.

Trial and Failure (13:39)

Even the most successful baseball player is not always successful at the plate, and that’s our life too: not every line of code we write ends up shipping, and most of the day our code doesn’t work. I used to teach high school, starting in an all-girls high school, and I attended gymnastics events to see the students. It was my favorite, because when a student would fall off the bar, they would get back on like nothing had happened and just continue their routine. That was just part of what you were expected to do. And yet, I would look in my math classroom, once students have fallen off, I couldn’t get them back up on the beam. Therefore, we have to realize as we’re teaching students that we’re there also to motivate them, to encourage them, and to make sure they have fun.

Xcode Playgrounds - The Future of Teaching Programming Interactively (14:43)

A couple months ago, Apple gave us what I consider to be a new gift. They gave us Playgrounds with a new format. On the opening day of WWDC this year, they expanded on that gift. One of the things they allowed us to do was to hide our resource code and to hide things where the students can’t see them, so we don’t have to expose the complexity right away. They also gave us an ability to see the values, not in the Assistant Editor, but in the sidebar — a substantial improvement.

TurtlePlayground: Leveraging Playgrounds to Teach - Demo (15:32)

One of the things that I did with Playgrounds was write a version of Turtle Logo where kids could type in turtle, then go ahead and click on the value history; they could see the turtle right there, next to their code.

Then I open sourced the Turtle Playground on GitHub — recently updated for Swift 2.0, requiring Xcode 7, and leveraging the new Quick Look preview.

[Daniel demonstrates gradual concept acquisition through learner-orientated structured discovery: “as they get exposed to more and more, I can teach them more about Swift”]

The Purpose of TurtlePlayground and Xcode’s Playgrounds (21:45)

What I’m not here to do is to tell you, “Use this!” What I’m here to do is say: Look at these toys we’ve been given. Come up with your own fun environments. Share them with the rest of us. Let’s find ways of teaching our kids, and each other, and maybe people who aren’t kids but are new to programming, in compelling ways. Because man, this interactive programming is kind of compelling. I’m in! I’m ready to do this with you!

Q&A (22:07)

Q: How do you feel about the new Playground features with Markdown support? Do you see it used for interactive lesson plans?

Daniel: I’m very happy with them; if I could sell them and charge for them, I would write all of my books in that format. I like how you can now navigate on them from page to page, and have per page resources and project-wide resources. Furthermore, I used many fantastic features of the new Playgrounds in the presentation itself. Apple is doing fantastic work and it’s a great teaching format.

Q: Daniel, you impressed me with your focus on bringing students along with you, and how to think about what they need to learn first, doing so without making big leaps. What can we do to spread this learner-oriented way of teaching to other types of education?

Daniel: I don’t know the answer to that. I come from mathematics, and I used to train math teachers. The issue with school standards is that they don’t allow us to do that because the standards regulate the material that must be taught per grade. I worry that a system that stresses testing gets in the way of teachers that want to do that.

Nevertheless, I love being patient with students and realizing that you don’t need to know everything. There’s a book called The Newton’s Method Approach to Learning that claims that I don’t have to teach you the whole truth. I can start somewhere and get you close to the truth, then expose things over time to teach you better, and I just love that metaphor.

Q: If kids don’t need to know public static void main, why should pros know it? Why isn’t this how I write my iOS app?

Daniel: I don’t know why it isn’t. That was really your answer too though, wasn’t it?

Q: Your talk reinvigorated me in my hope for the future of education. Are you still in the education space?

Daniel: I’ve been out of the education space for a while, but this is my way of contributing back to those high school teachers who teach programming. I am now mainly a developer and a contractor, and I write and teach.

Q: What is the killer feature that you wish Xcode’s Playgrounds had?

Daniel: I wish it ran in an iPad. I wish I could embed them in iBooks because I could reach more people. If I could write about something and then the student could experiment with it, I think that would be magical.

Q: Playgrounds reminds me of IPython Notebooks from the Python community. Is there anything you’ve noticed them doing that captures your attention regarding this way of teaching?

Daniel: I don’t know much about that world. I came from Mathematica Notebooks, where they would do similar things. What I like is that this opens it to our world of iOS and Mac app development, which is what I’m interested in, but others worked with it. I believe Jeff who turned me on to some of the things people are doing with Julia and those interactive environments as well. However, I am unfamiliar with Python’s tools that can be used for teaching.

Daniel Steinberg

Daniel is the author of the books ‘A Swift Kickstart’ and ‘Developing iOS 7 Apps for iPad and iPhone’, the official companion book to the popular iTunes U series from Stanford University. Daniel presents iPhone, Cocoa, and Swift training and consults through his company Dim Sum Thinking. He is also the host of the CocoaConf Podcast.