 Good morning, everyone. So as you said, I'm Jason Clark. I work at New Relic on the Ruby agent, but that doesn't have a whole lot to do with what we're going to talk about here today. If you are interested, I have posted these slides at jasonrclark.com slash kidslides. That'll redirect you to speaker deck where that is if you want to follow along. There's not a lot of presenter notes, but you'll get the gist if that's easier for you to follow along with or want to take a look back at it at some point. But what I'm here to talk to you about today is teaching very young children some programming. Now, I'm a father. I have two kids. They're three and six. And a lot of the resources that I found when I started looking into kids programming were kind of geared for a little older age. They were looking at eight, maybe 10-year-olds, middle schoolers that were able to pay a lot of attention to lists of instructions and that knew how to do more math and had kind of some of these assumptions baked in. And the fact of the matter is that I'm a really impatient person when it comes to certain topics. And I didn't want to wait until my kids were 8, 10, and 12 years old before I started getting them into programming. In the world today, our kids are surrounded by electronics. But a lot of it is them being consumers. A lot of it is them being fed experiences through their iPads or through laptops or televisions. And not enough of it is about them creating things, about them making things themselves and having the power to bring their imagination to life through these devices that we have. And so that's kind of the goal of this talk, is to talk about how I've started working with my daughter and I've done a little bit with a few other kids that are around the same age group to kind of teach them and give them a better idea of the possibilities that are there in computers and in what they can do. Do I need to, hm? There it is. Bad choice. All right, so that's kind of the grounding of what we're going to talk about today. We're going to look at how you can teach very young children programming and get those ideas in really early with them about them being in control. My father of two, like I said, my son's three. My daughter is six. And later on, we will have a small presentation from Cora of some of the work that we've done together. But I'm not a teacher. I'm not a developmental psychologist. But all of these things are things that I've taken from spending about a year with Cora, teaching her how to program, and spending that time with her. So hopefully, you'll find some of it useful. We're going to start off by talking about expectation, because expectation is a big part of being successful in this sort of venture with a kid. Both the expectations that you have is the person that's teaching and that's guiding them in it, and the expectations that the child has of what they're doing. We'll talk about the mechanics. There's a lot, too, trying to teach a five- to six-year-old programming. Programming is not necessarily always a natural activity for adults at the best of times. And so finding ways to make that easy and approachable is really important. Then we're going to talk about ideas. This is kind of the fun part, where you let your imagination run wild, and take a look at some of the tools that are there to support you in bringing this to children. We will have a demo of some code from my lovely little co-presenter, which will be a lot of fun. And then we'll close up with a small code about an open-source project related to this that I care about a lot. But I want you to come away from this with some really good information and maybe some new ideas about how to approach this sort of topic. I don't want this to be something that's kind of silly and frivolous. This is not an excuse for me to just put baby pictures on the screen. This isn't an opportunity for me to show the crazy ways that my kids might choose to use plastic power tools or anything like that. Hopefully there's some real information here that you can draw on. So let's get into it. Expectations are critical in any sort of relationship that you might have. But let's talk first about the expectations that your kids or the kids that you're teaching might have coming to a computer. They're surrounded by electronics these days. And if you tell a kid, hey, we're going to make the computer, we're going to program something very often you'll get asked, oh, can we build a game? And they might have some ideas about what that means when they have a game in mind. And if you turn around and the thing that you're going to offer them looks a lot more like this, you might not have a lot of success in meeting their expectation and finding something that they're going to be able to join you with. So it's important that you try to narrow that gap, find the ways to bring their expectations into line with what you're going to do. One of the key parts of that is that things should be very visual. Whatever you're planning to do at a five to six year old level should very quickly present them something that they see. There's not a lot of space there for things being abstract or just printing text to a command line is probably not going to grab them. But drawing basic shapes to the screen, which can be really simple to do, is a great way to get their attention. It's also important to set their expectations in the discussion that happens beforehand. Talk about what the program is and prompt them in the ideas of what you're going to build together. I spend as much time with Cora when we're doing these activities talking about the program and the plan for how we're going to build what we want to build as I do sitting there at the keyboard and actually watching her type and helping guide her in that. So do your plans on paper, do your sketching, do your drawing, talk about it first to set the expectation of where you're going to arrive. And it's really critical as well that whatever tool you're using and whatever approach you have has some sort of quick feedback. If it's going to take five minutes before you're going to get any sort of signal out of this, it's going to be kind of hard for you to get their attention and keep it. So especially in the first couple of times that you sit down with them at the computer, be prepared as the person guiding them to be able to get them somewhere quickly and get them into something that they can see that the things that they're telling the computer and typing in are having an impact and get that feedback loop established early. It's good too to remember that when you're working with five to six year olds and young children, the Angry Birds example, their expectations might be fully fulfilled by something like this as well. Remember that their mindset is not necessarily the mindset that you bring to it as an adult and you can find that middle ground that's something that's approachable and fulfilling to them all at the same time. All right, but this is a two-way street with expectation. There's not just expectation on the part of the child learning to program. There's expectations that we bring to it as well as adults. And one of the things that you need to expect is that this is going to take patience. Anybody that's been around kids and dealt with them, there's an amount of patience that's required but this is particularly an activity that is not really easy. It's not totally approachable and natural at the best of times for some adults. Programming as much as we might feel like it's a totally locked thing for some of us and we've been doing it since we were kids, this is totally easy, it's not. And so it's gonna take time to be able to bring your child along on that to be able to be successful. It's also really critical to be aware of the attention span of the child that you're working with and how long you have to be able to work with them. There's, I've heard varying estimates but a good rule of thumb is that you can really, really get their attention for maybe about as many minutes as they are years old and five to six minutes, it's not a lot of programming time. Now with Quora, we're able to go longer but a lot of that is because we'll frequently change the activity that we're doing. We'll talk about the program and draw about it for a few minutes and then we'll work on typing it and then we'll pick a different aspect of it to work on. So switching things up can help to keep their attention but also just being prepared for the fact that their attention is going to wane the longer you go on and making those changes proactively is a really critical thing for them to be successful. It's also really important to remember that their recall is not gonna be an adult level of recall. As many times as I've done this stuff with Quora, I wouldn't expect that she's gonna be able to sit down and write out these lines of code exactly like we've done purely from memory. It's unrealistic to have that expectation and it's not really the important part of it. The important part is that we've built something together and that she's gotten the idea that this is approachable and something that she can do. All right, so that's expectations. Let's talk a little about the actual mechanics of how you program with a very young child. One of the most important things that you'll run into right away is typing is a really big, oh, I'm sorry, that's the wrong typing slide. I didn't, the sort of typing I'm talking about is this sort of typing. When it's a five-year-old, they have probably interacted with computers but it may well have been touchscreens. If they've worked with a keyboard, it's probably not something that's really comfortable for them yet and so finding activities in your programming that are able to build into and teach them, typing skills is actually one of the really valuable parts of this. Quora very quickly realized that making capital letters on the keyboard was something that she didn't know how to do and she asked about it and so some of that typing you can teach them as you go along and it's a good way for them to practice something that's gonna be a great skill for them later on. I think probably the most important thing about typing though is that you as the adult need to try to keep your hands off the keyboard and I know that this is really hard. Watching somebody type slowly and adult type slowly is tough for me at times and it's a tough skill that Quora is just beginning to pick up to do it but it's really valuable to let them have the control. Let them be the ones that take control of the computer and tell it what to do. That goes hand in hand with the next point which is that there are going to be mistakes. There are mistakes when all of us type and one of the best things that you can do early on is teach the kid how to correct those mistakes. Quora actually led me in this. I didn't think about it until something got mixed up and she was like well how do I change it? I've already typed all this text in. So show them the delete key early. Show them the keys that allow them to navigate around the text and be able to change it themselves and encourage them to fix their mistakes and ideally maybe to start finding their mistakes once they've got a little further on and they're familiar with what you're doing. Fixing your own mistakes is critical to being able to gain confidence in doing this sort of programming. Asking questions is a really critical part as well of being able to help the kid to engage with it and be involved. I can tell her oh we should probably put this here and it should probably be 100 pixels wide but it's a way more engaging experience for her. If I ask her well how big do you think it should be? And then we try out the numbers that she comes up with or we try out the colors or the positioning. Asking her rather than me feeding her all of the information just for her to type in helps her to develop her confidence about how the program is being built and helps her understanding of what's going on. It's also really good to be able to draw things where they can make quick visual comparisons. So the best example of this is code, right? So we've done a lot of drawing using a program called Hackity Hack that we'll see a little later on. And this is something that she can look at and she can see where the difference is between these two lines of code. Comparing those things and seeing what happens when the program has those differences and being able to look at a line of code and compare it to another one that we've already written and say what's different. It's a really good way to help her to understand what the different pieces and parts of it are and then understand what impact those changes have. Again, keep your hands off the keyboard though when you're doing these sorts of things. There will be repetitive code like we looked at and you might be tempted to, oh well it's just gonna be like that one here let me do that because it'll be faster if we just bang out another line of this. But again, keep your hands off, let the kid type it in and that time spent building that additional line of code that looks like the earlier one helps cement that idea and how that's structured. Keeping things simple is a really important part as well for having it be accessible and successful for a kid to approach. And part of that, to be honest, is avoiding things like keyboard shortcuts and avoiding spending a lot of time focusing on those elements of programming. You know that's important as a professional programmer but it's not really that important at this age. Now the counterpoint to this is that if they start asking for some of these shortcuts then you have the opportunity to engage and help them to discover something. Cora noticed that I was closing windows without using the mouse like I had shown her how to do because that would be simpler. And so now she has the keyboard shortcut to do that but that was her discovery rather than me loading her up with a whole bunch of ways that she can navigate faster through the system. Similarly, formatting as much as it kills me to say it it's just not that important. How many spaces you have between things? I mean, unless you're a Python programmer then it might matter. But in Ruby, it doesn't matter that much. Code cleanliness and some of these things, there's gonna be time for that later. Five to six years old, just not the time to really worry too much about it. Repetition is key to having success in a child learning this sort of thing. And oftentimes, we've found sort of similar veins in the programs that we're building to be able to repeat concepts and repeat ideas. So the drawing program that we use, it has the same ordering for coordinates and width and height of things. And so we kind of have a little mantra about, well, that's the left in the top, the width and the height. And that repetition, the fact that all of these elements behave the same, the fact that we're doing that over and over and over again has helped her to be able to internalize it. There are other little mantras as well that we've got, like click save and then click run. And I've actually had a couple of times when I've forgotten to click save and she pointed out that I hadn't saved my work before I ran it and I was running the risk of losing things. And it's a great moment when your kid can correct you on something like that. So repeat things, find those little cycles that you can come to again and again to help them to learn. Focusing on the similarities between the things that they have learned and the things that you're introducing is also a good way to help keep them engaged and make things easier for them to approach. So for instance, one of the first things that we learned was drawing a rectangle. And this is how you draw a rectangle. It's filled in with black. And when it came around time to learn to draw an oval, well, there's a lot of similarity there in how that's structured. Now, I chose these elements as purposeful things that we built together and the progression that we went through. We could have gone and drawn, oh, something totally different. We're done a thing with a button or a text box or something else. But instead, I chose things that were very common that were very similar to each other so that she would have a path through that she understood that was like what she had done before to engage with. All right, so that's a lot of mechanics. That's a lot about ways to do it. Let's talk about some ideas for things that you can do and tools that you can use for that. There's a lot of code that's out there for kids to program. And like I said, some of these things are targeted at an older audience, but with a little bit of assistance, some of it can be very useful even at a young age. Scratch is a well-known program for this. It's a visual programming environment online. It comes from MIT. So over there on the right, you stack together instructions that will move a character and cause it to rotate or move around or do different animations and things. It also has a lot of good drawing support and you can change backgrounds and dress the characters up, which is a lot of fun for the kids to do. This is a great way. I haven't used it yet with Quorumuch, but this is probably gonna be a next step for her to be able to take a little more direct control in constructing these sorts of sets of instructions. I've heard about people having a lot of success with Minecraft as well, especially in creative mode. The 3D spatial building that you can do to, what's it, I wanna make a house. Well, how do I build that? How do I lay things out? How do I build that? Is kind of an abstract way of thinking that's really valuable for kids to be able to approach. The sky's the limit with that as well as far as modifications and things that you can do as far as actual programming later on, but just at an entry level, it can be a really valuable tool for encouraging a different sort of thinking and construction than kids may have encountered in their computer experiences so far. Moving things back a little bit to the Ruby end of the spectrum, there's a thing called KidsRuby. So it's sort of a development environment where you can write Ruby on one side and you see the output on the other. They've got a lot of great curriculum and kind of lessons for kids to work through. I would highly encourage this as something to check into, especially if you're wanting to teach your kids Ruby. And then the last one, and the one that we'll spend a little bit more time with is the venerable old app called Hackety Hack. So this was built by Why the Lucky Stiff quite a few years ago. It's a Ruby development environment. It's built on a UI toolkit called Shoes, which we'll talk about some more. And it provides a really simple Ruby DSL for drawing and for doing different form elements and designing programs. And this has been the thing that Core and I have done most of our work with. And that's been a lot of fun to do. So what are some ideas for types of things that you might try to build with this? We did a lot of things around typing. Like I said, this is a vital thing for a kid to be able to get to grips with. And so we built programs that helped Core to be able to type and made it personal for her. The typing program on the right when she types the words in which it has her name and her brother's name and mom and dad and our dogs. A picture that she knows or that she's chosen comes up. That's really engaging and fun. Core is very interested in math as well. If your kids are into math or into counting, that's something that's really great to be able to build games and small programs around. This eventually is gonna be a math bugs program. That's the beginning of a worm there. It needs a little bit of work, but it presents you with a problem and you answer the question and that's where it goes. It's something that's very easy to build in when math is involved and also teaches the kid things that are outside of just the computer realm. It's fun to build adventure games and we may take a look at this one as well. Designing stories and narration and being able to integrate the kid's drawings or things into that program is simple to do and again really gets their attention when something that they've made is showing up on the computer screen. And then for us, probably the heart and soul of using Hackity Hack is the drawing primitives that it provides. So this is actually that program that I showed a few moments ago running in Hackity Hack and this was actually contributed back to The Shoes Project as one of their samples with my daughter attributed. So she's had her first open source commit at five years old into her project. But it's a lot of fun to be able to make these sorts of simple drawings and it's very valuable to be able to give her the skills to deconstruct how to build this drawing. That's the fun part of the program is that we figure out how to put the thing together and then we make the instructions to go make that happen. All right, so that's a lot of talk. It's demo time. Cora, would you come on up? It's time for some Hackity Hack. Hello, my name is Cora. All right, so Cora, before we show the program, I wanted to ask you, what is your favorite part of programming? The fun. Say it into the mic. The fun. The fun part, yes. And what have you found to be the hardest part of programming? Typing. Yeah, that's probably pretty true. All right, so what are we gonna show the people today? I'm going to show you a program it means my dad have been working on for weeks. All right, so what is this program? This program is called Star Wars. So where did you get the idea for that? I got the idea from the movie Star Wars. Excellent. All right, so let's show them. I'm going to show you the program. Yay, and so we figured out how to do all of this drawing together, didn't we? You helped figure out how to draw all the characters. Is there anything special about this program? So do anything else? Yes. Yay, so you press D. Oh. Yay. That's super cool. So is there anything else about the motion that you want to tell the people? My dad made a bug and I spotted it. Yeah. Yeah. It's still, if you press the D too often, Darce Lightsaber would fly off the other edge of the screen and she was, we fixed it now, but she's some pretty awesome QA. So did you want to show them anything else? Here, break my own rules. All right. So what's the other thing we're gonna do? I'm going to show you a program that me and my dad made a long time ago. Yeah, so this was one of our first big programs, wasn't it? Uh-oh. Uh-oh. So why don't you go down? I think the princess will come into view if you go down far enough. Yay, there's the princess. All right, so where's the princess gonna go? In here, can I scooch the window over real quick? If I scooch it over just a little, we can see the dog, I think. So that's, maybe not. Should have run this at the lower resolution. The dog turned into a door. And then who's that? The queen, king and queen. Cool. So we've talked a lot about how we need to extend the adventure. Some other things should probably happen, but that's as far as we've gotten so far. All right, is there anything else that you want to tell the folks about your Ruby programming? What program did you want to do? I think that's probably good. I think we're probably okay. Yes, let's see. Oh, did you want to do the, I mean we could do the Angry Bird Game, or no, I'm sorry, the Fun Bird Game. No trademark violations here. I think it's still further over. Yes, Fun Bird Game. Let's run that. I bet this'll be pretty big though, isn't it? Let's see how it goes. Yeah, no. Too big for the screen. Yeah. What happens if you click though? They'll see a little bit of it. Zoom. Awesome. All right, well thank you for helping me demo core. That was really cool. You're welcome. I have never actually demoed code live in a presentation and I still haven't. I had my daughter do it for me, so it's kind of a scary thing and I'm glad she was here to help. So briefly we're gonna close with a little coda to talk about shoes. So shoes is the library. It was originally built by Why the Lucky Stiff, Rubyist several years back. And the intent behind it was to build hackity hack and to provide a really easy DSL for people to build these sorts of desktop applications and do drawing from Ruby. As anyone who was around at that point in time knows why chose to disappear, he left and a lot of his code kind of languished for a while. Shoes in particular was written as a native library. It was a lot of C code to be able to run on Mac, Windows and Linux because it's all cross-platform. And so for a long time, there wasn't much motion with it. But there is a small community of people that have been interested to keep shoes alive and to make this something that goes forward and people still have. And that's happening through the Shoes 4 project. There has been a lot of experimentation with many different ways of doing this and Shoes 4 is kind of the outgrowth of that. They're choosing to build it on JRuby to use the SWT toolkit from Eclipse. You know Java knows a lot about doing cross-platform UI and so we can kind of build on top of that and not have to deal with a lot of those problems ourselves. It is built, the project is being structured so that it will be pluggable on the back end and there's been a lot of discussion of possible other ways of getting that UI there. Maybe something QT-based that could run on MRI, something that uses Opal and an embedded Chromium browser to admit it to JavaScript. I mean there's all sorts of crazy ideas that people have and all of those are gonna be possible in the future once Shoes has hit its next full release. So, I'm happy to announce that Shoes is actually available as a gem so this never happened with the older version of Shoes. It was installed as kind of a binary package but with Shoes 4 you can do a gem install minus pre for Shoes and then if you have a relatively recent version of JRuby you can run your Shoes code just by saying Shoes and the file and I would encourage all of you to go out and maybe try this out. Write a little Shoes program, poke at it and definitely report issues back. This is still very pre-release. We're not even at a release candidate state and we wanna hear what your feedback is. I would also encourage you as well that if you're interested to get involved in an open source project this is a very accessible project with a lot of low hanging fruit for people to be able to come in and contribute. You know, I had never really been a contributor in open source a year ago. Like I really wanted to be but I was intimidated by some of the big projects and I didn't know what to do and I happened to stumble on this through doing the programming with Cora and it has been such a great experience and they've been so open to people getting involved. And so if you're interested, if you want to there's some things that are tagged with a newcomer friendly tag or logging issues or just writing sample programs. You know, this is a great project for you to get into. So, where have we been? We've talked about how to teach a really young child to program. The expectations and the mechanics of how that works. We've looked at a lot of different ideas for cool apps and different ways that you can build those things. We had an awesome demo from my daughter Coraline and we talked a little bit about shoes. So, hopefully this has got the juices flowing for you. This has got some ideas going about the kids that might be in your life that you could give an introduction to programming to maybe at an earlier point than you had before. I've got a list of resources up JasonRClark.com slash kids code. If anybody's interested in the wonderful capes that we are wearing as well. My wife is starting a little side business with those. And at empirecapes.com, so feel free to hit her up. She does custom work, it's really great. And last, I want to leave you with this image. I want to leave you with this as inspiration. So, I learned to program as a kid from my dad, who is a programmer. And this is Cora with my father, showing her the shoes code that she wrote and explaining how her program works. Like, this is awesome. This is why I keep working on shoes and this is why this is a worthwhile thing for people to get involved in. So, I hope that that inspires you to get out there and do some programming with some kids. Thank you.