+6  A: 

To turn the kids onto programming, you drive up to the kindergarten in your Rolls Royce and walk in with your gorgeous significant other.

If you're not Bill Gates, then you'll just have to explain that you sit in boring meetings for 4 hours a day, print cover sheets for TPS reports for 2 hours, and stare at stupid stuff written by preceding clueless programmers for the other 6 hours. (No need to mention that then you field calls from people who are maintaining your last program and who think YOU are the preceding clueless guy).

No, i'm not bitter, why do you ask?

Seriously, (I am sure I'm plagiarizing from one of those 3 threads subconsciously), have them play "give instructions to me on how to do Y", with you doing things the Genie way - all wrong unless instructions are very precise and clear. Actually mention genie as good example assuming the kids saw Aladdin.

;^)

DVK
You make it sound like its a bad thing! Wait a second...
ChaosPandion
We live in the house next to the kindergarten, but the street is one-way in the opposite direction. So getting there by Rolls-Royce would be somewhat difficult... not to mention it would likely get stolen by the time I finish my talk :-P
Péter Török
At my job, we actually use the acronym TPS
phsr
I wonder if TPS actually stands for something or was the acronym invented for Office Space...
DVK
+21  A: 

Don't try to show them anything on the computer. Watching someone else type is boring for adults. For 5-year-olds, it's a recipe for anarchy.

Instead, make it interactive. Some form of "Simon Says," but have them be the programmer.

Anon
Nice comment. I doubt if they have the attention span or zeal of a developer trying to keep his/her job or fighting for a pay raise. However, kids love games.
Phil
So it would be "sudo" instead of "Simon says"? ;-) Seriously though, it is a good idea, I will think about it more... thanks.
Péter Török
sudo make me a sandwich http://xkcd.com/149/
Bratch
+39  A: 

What about doing a kinesthetic version of Logo?

Say you have two kids side by side. Can they figure out how to switch places using only the commands Step Forward, Step Back, Turn Left 90 Degrees, and Turn Right 90 Degrees? I'm sure there are other games like going through a maze, etc.

I'd think you'd keep their attention if you can keep them moving. This will spark the interest. They'll figure out later that the job is sedentary. ;)

John at CashCommons
"I'd think you'd keep their attention if you can keep them moving." Couldn't agree more.
Péter Török
Put the two kids standing at the front of the room, but let the kids in the chairs give the commands. The standing kids don't have a say in what they do -- they have to follow the commands given from the class (obviously you'll want to control the crowd somehow). The entire class is engaged.
lance
Also, if you decide the kids are particularly bright, you could show them how to improve the commands they come up with (assuming you're smarter than the kids -- that can be a risky assumption sometimes!). Create some incentive for the command-givers (candy, praise, whatever) that motivates them to make the commands "better" by some measurement you introduce (fewest steps to completion, etc).
lance
I like this the very best. You could have kids (forgive me if this is the point of Logo anyway, I've never used it) program series of actions for a number of kids (go ahead 2 squares, turn right, go ahead 5 squares...) in a way they don't crash. An advanced level would be having separate teams build "programs" that need to run alongside without crashing (Kind of like API programming.) It would need some additional incentive component - not to just do steps, but to reach some sort of goal. Maybe getting a flag in a grid of squares and bringing it to a different spot on the grid....
Pekka
Pekka: Logo is a programming language that I used Way Back When in my middle school computer class (on a Commodore 64 IIRC). You command this turtle to go forward, turn X degrees, pick its pen up, put it back down, change the color, etc., and you can draw things with very simple commands.
John at CashCommons
At first, you could have people direct the turtles by telling them what to do -- then when they've got that figured out, make them write down the instructions on the blackboard first! This could even segue into branching/looping. ("What happens if there's a chair is his way? What if you don't know where the chair will be?")
Ken
@Ken: Remember, this is for five-year-olds. Most of them won't know how to read.
Michael Myers
mmyers: They won't know how to read English, but that's not the only way to write things down, and probably not even the best way to write it. (Even us professionals don't write programs in English!) I'm sure they can recognize a sequence of arrows indicating which direction to move next.
Ken
Thanks SO community for my first content-related silver badge! ;)
John at CashCommons
I like this idea as well
KennyCason
A: 

Sell them on the value of unattended automation. Have a kid walk to the front of the room and show the class what he does each night when he's brushing his teeth. Then have that same kid show you what he'd be doing during that time if he didn't have to brush his teeth.

Then tell that kid that you know how to move that brush across his teeth while he's doing that other thing that he'd rather be doing, and tell him he'll never even feel it. His teeth will just magically be clean next time his mother goes to inspect them.

Then maybe write some pseudocode on the chalk board that shows the Brush API accessing the Tooth resource in a background thread behind the Favorite activity.

lance
Hmmm.. this might have consequences the other kids' parents may not be happy about... And only _some_ of the kids can read _some_ uppercase letters (no words yet!), so pseudocode is a no-op :-(
Péter Török
Got it. So, code of any kind (indeed, the thought of code) is out. And I see your point about the toothbrush thing. The point is to sell the kids not on programming, but rather on the value/conveniences it creates for people's lives. I upvoted John at CashCommons's answer, as that highlights the logic of programming. If you could figure out some way to show them the logic (again, see John's answer), and *then* highlight the automation of programming and the way it makes life more convenient for people, you might have a hit on your hands.
lance
+3  A: 

To kind of borrow from the other ideas already posted, a game of Simon Says may be the way to go. However, you can stress how computers will do EXACTLY what you tell them to do. So, if the kids are Simon, and they say, "Simon says sit down." then you just sit down on the floor (not in a nearby chair or anything). Follow instructions to the letter and not to the spirit. (Of course, this may be tricky getting the kids to give ambiguous instructions, but I'm sure you can come up with something.)

Other than that, you could also talk about video games or other computer "things" that the kids may have used and you can say that programmers, like yourself, create those. And then maybe jump into the Simon Says to show how it works. Of course, this could result in a bunch of kids growing up thinking that you spend your entire day at work playing Simon Says with a computer...

JasCav
+3  A: 

I sometimes regard my job as playing with Lego bricks. You start with a set of bricks of different sizes, shapes and colors, and from that you build larger things. You can build castles or star wars robots using the same set of bricks.

And, it's about the same amount of fun!

jdv
Totally unrelated but maybe relavant: as far as my kids are concerned, they have no clue (and don't care) about the distinction between internet and computers.
jdv
@jdv Yeah, one of the ideas I am actually toying with is to let the kids play how packets are routed over the net.
Péter Török
I like the Lego analogy. However, my 5 year old has just inherited the Technic Lego Bulldozer I had as a child, and after spending a couple of hours helping him to build it, all I can say is, Lego (still) Rocks!
Skizz
+3  A: 

One of the major perks of programming is the ability to create things. To make dreams come true. I don’t think this will appeal very much to small children who have no problem to let their imagination roam free anyway. What do computers bring to the table?

Instead, you could probably interest them in problem-solving, puzzles. The kind of thinking that is needed for programming. I probably wouldn’t use a computer at all; instead, let them solve an engaging mathematical puzzle. It doesn’t have to be hard but it should involve creative thinking.

Konrad Rudolph
Could be interesting, but I can't easily think about math puzzles suitable for 4-6 years old kids. My own are right now happily counting things all over the place, and the elder one just started to grasp that 1 + 2 = 3 and 5 - 1 = 4.
Péter Török
Let's find out how well small children perform in solving a TSP ;)
Dario
+1  A: 

Give each child a cut out shape; circles, squares, triangles, different colors etc. Explain how programming is giving instructions in specific order. Hold up a picture of a smiley face and walk the kids through how to construct it. Yellow circle, black dot, black dot, arc. Then show a more complicated picture, and have the kids come up in order based on your instructions. You can even make a mistake (like putting the yellow circle over the black dots) to show how 'Bugs' creep into a program.

WombatPM
+4  A: 

I think you could do the following demonstration in 20 minutes. Maybe it's more suited for older children. I don't really know what kindergarteners are capable of. I'd personally avoid trying to explain programming, and instead describe a problem that we as programmers solve. For example, if there are enough children, you can demonstrate the Internet to them interactively.

Part I: How it Works

First describe to them, preferably with props, how the Internet works. Bring in a laptop connected by a cable (for visual effect) to a home router. Tell how computer programmers make all sorts of devices, including the programs on the laptop, the program in the router, and applications in other devices connected to the Internet, like cell phones.

Explain how computers aren't connected directly to each other because it's impossible to connect a cable from every computer in the world to every computer. You'd need a billion cables in your house. So instead, computers connect to routers. And routers give packets of data (for example, e-mails, pictures, or videos) to other routers until it finally gets to the other computer.

Describe the rules for a computer to talk to another:

  1. A computer can only give a packet to its router.

  2. A router can give a packet to the computers connected to it, or to the nearest router.

This explanation should be very short, but emphasize the rules. You should probably equate packets with e-mail or pictures.

Part II: Interactive Time

Then have 3 children volunteer to be routers. Everyone else is a computer and divide them up evenly. It'd help to have colored cards they can hold. Like the person holding the dark blue card is router that can talk to all the people holding light blue cards. Let's say you give out blue, red, and yellow cards.

Arrange the "routers" in a line, blue, then red, then yellow. The blue router will then have to give a packet to the red router to give it to the yellow router. Group the other kids around their routers.

Bring "packets" for each child. Mix it up with photos, letters, a print-out of tic-tac-toe to symbolize a game, or whatever. Start by having a single red computer send to a yellow computer.

"Ashley, pick a yellow computer that you want to send your picture to. OK, to send the picture to Brian, you have to give it to your router, Kelly. Tell Kelley who should get the picture. Kelley, you are blue, so you can't give the picture to Brian. You have to give it to Timmy. Tell Timmy who should get the picture. Timmy is red, so he can't give it to Brian. He has to give it to Renee. Renee, you can give the picture to Brian since he is a yellow computer and you are the yellow router."

Then have everyone think of one person to send their "packet" to, and watch your impromptu network in action.

Part III: Relate back to computer programming

To conclude, ask the routers whether it was easy to be a router, or hard because there was a lot of people trying to give you pictures at one time. Point out where things went wrong and tie it into real problems that we solve.

"I could see that Timmy was overloaded with packets because everyone had to send their packet through him. As computer programmers, we have to solve problems like this every day. One way we could solve it is to give Timmy 4 arms. Or maybe add another router so that if Timmy has too many packets to deliver, you could give it to a different router instead." Or "Maybe we want pictures to be delievered faster, so we could ask the router to deliver the picture first before delivering any other packets."

indiv
@Péter Török: Hah, I realize after going through the comments that I must have subconsciously seen your comment about internet routing and stole the idea.
indiv
@indiv That's fine, thanks for elaborating the idea. I haven't got this far with it :-)
Péter Török
+1  A: 

I think I'd begin by talking for 2-3 minutes about computers, and that they follow instructions about what to do.

Then I'd demonstrate with a prebuilt LEGO Mindstorms robot and program it a couple of times and run it, just to show them that it follows the program. Mindstorms programming is pretty visual and simple to grasp.

Finally I'd try to explain that there are computers running programs almost everywhere, even in traffic lights, microwave ovens and their favourite toys.

Guge
I have newer owned a LEGO Mindstorms kit, neither I do know anyone who has one. Will probably take the excuse to buy one as the kids get bigger though ;-) The other ideas are useful, I am thinking along a similar line.
Péter Török
+2  A: 

Talk about how pervasive computer programming is - it guides airlines, phones, cars, how you buy your tickets online etc.

Then teach them to write a simple program symbolically - 1.Draw a grid on the blackboard.
2.Draw cheese at one end, and a mouse at the other end. 3.Have them "program" the moues to get the cheese!

Walk them through their failed attempts as a class, maybe have the mouse fall in traps or something in the grid. They would get a thrill out of it.

+6  A: 

Make them write short programs for you to do simple things (like enter the room and take a seat) and then execute them literally to demonstrate the "bugs" -- where they were not specific enough or didn't take something into account, so that you will do things wrong. Try not to hurt yourself in the process. It should be funny and will get them a pretty good idea of what an algorithm is.

MK
+164  A: 

I've done this before.

I laid down a lot of paper towels on a table, and got out a loaf of (cheap) bread, a small tub of butter, a small jar of jelly, and a plastic butter knife.

I said to the kids, "How many of you think computers are smart?" Most of them raised their hands. I said, "Computers are really dumb. People are smart. You have to tell a computer everything. It doesn't know how to do anything. I'm going to show you what I mean. I'm going to pretend I'm as dumb as a computer, and you guys tell me how to make a sandwich."

And when the first kid said "open the bag of bread!" I ripped the bag apart and let bread fall randomly all over the table. That got a lot of giggles. I continued to take the kids literally at their words until they learned to give short, specific commands, and eventually we ended up with a butter and jelly sandwich. There was a lot of laughter but they came away understanding, at least a little, what a programmer does for a living.

(I should note, I've also done this demonstration with adults in an "intro to programming" class, and it works just as well with them.)

Jim Kiley
+1 kids love it when grownups are silly AND they get to tell them what to do :)
Chris McCall
Sounds like a great idea for promoting fun and having them learn through a hands-on approach. Wish I'd had this demonstration in kindergarten!
Peter
That's quite the procedural programming approach tho. ;-)
herzmeister der welten
I'm sorry to comment just with a laugh, but @herzmeister der welten: you just made me laugh really, really hard. I've really enjoyed this question. This (Jim's) is a GREAT answer.
lance
I once participated in a similar demonstration with grade school kids. The kids howled with laughter when they neglected to mention using the knife to spread the jelly on the bread.
jschmier
jschmier: Did you stick your finger in the jelly jar? :)
John at CashCommons
@herzmeister - On the contrary! Nothing could be more **OBJECT** oriented ;-)
Péter Török
This is one of the best answers I've seen to any question, anywhere. Thanks.
Mike Dunlavey
Beautiful!!! Hope these kids/adults do not give any other mischeivous commands like EXIT, QUIT he he..
Bragboy
+8  A: 

I've never tried this, but it might be fun.

Physically demonstrate an algorithm by using some attribute of each kid as the input data.

For example, get them to form a line (in whatever order they go to initially), side by side. This might work better in a semi-circle so they can see each other doing the exercise, but there has to be a break in the line somewhere. Then, starting at one end of the line, get them to take turns doing "if the classmate on your left is taller than you, switch places; otherwise, stay put." The game ends when you go through the line and no one switches places. Get them to observe the results. (Hint: bubble sort!)

Jon Seigel
This is called role-playing and it has a firm place in the teaching of CS. Good idea.
Konrad Rudolph
Good idea, and (for somewhat bigger kids) could be used together with e.g. a demonstration of binary search in similar fashion... but that would be too much for these kids yet. Another worry for me is that I can't see a good way to explain why and how we use sorting, to link it to the main theme... I feel it may require too abstract an explanation for these kids.
Péter Török
+2  A: 

How to teach kids what programming is?
Well, the first step is likely to get some cows involved!
Download a simple programming game (like IQ Marathon) onto the laptop and hook that up to a projector. While you're doing this you can talk about how being a programmer often means working with recent technology (and thereby giving a demonstration of you doing so).

Once you've got it set up (practice so you can make it work in 5 minutes or less), you can use the game to show very visually (and with cows!) how the computer only does exactly what you tell it to, and how you (the programmer) have to figure out what instructions are necessary to make it do what you want. When you get it right, everybody is so happy about your success that there are dancing cows!
From there you can answer any questions, or perhaps just let the kids try and figure out how to program cows themselves. Wherever they want to go, really.

Cows!

Task
+1 hahaha for the cows! :)
Otaku
As I mentioned in the post: no projector, no laptop. Even if I had a laptop, there is no way 20 kids can see the screen at the same time :-(((
Péter Török
Well, we tried it with my wife and love it... maybe I will bring a laptop anyway :-)
Péter Török
8 D The beauty of the cow solution is that it's fun for everyone and it demonstrates excellently what programming is all about in a format that *anyone* can understand. When you said "no projector" I assumed you meant "no overhead slides". When I say "projector" I mean "plugs into your laptop screen output port and lets everyone see the screen projected at 10'x10' size". Which not everyone has, but a lot of techies can get their hands on one if required. Often you can sign one out at work! "It's for demo purposes" should do the trick. 8 )
Task
A: 

Demonstrate a simple lego mindstorm robot and its corresponding flow chart. You wont have to show then any code and they can see the end result of your logic by watching the lego execute your program.

Athens
A: 

Kids likes things that "do something" and flashing lights.

For my sons birthday, I made a safe (box with electric lock and lots of leds) that was connected with the PC.

They had some questions to answer, and each response resulted in flashing leds (green for good answers and red for wrong answers). If they answered enough questions right, the leds started a simple animation which ended with a loud "clonk". The safe was now open and they could collect their rewards.

It was fun to build and the kids loved it.

Gamecat
+1  A: 

When I try to explain programming in a short amount of time to people who aren't familiar with programming, I explain it using Legos. With Legos you have a bunch of simple pieces, this is like the programming language. Then you can piece them together however you want and make anything that you can imagine as long as you have the correct pieces.

To adults and kid this is likely to be a very interesting analogy and it still demonstrates the concept of programming.

Also, you could even build a Lego car poorly, then also display a Lego car with very nice design, and show them that programming is just like this. You can program cars or robots or whatever you can imagine, but there's not only one way to do it, there are many ways to do it. some better than others.

I have gotten so many people to begin programming and even switch their majors with this analogy. :)

KennyCason
This is a nice idea which surely works for adults, and most probably for school age kids as well. However, I think that it requires too much abstract thinking for a 5 year old. Their mind is just not at that level yet.
Péter Török