News:

Endorsement from MysticWicks: "The most fatuous, manipulative, and venomous people to be found here are all of the discordian genre."

Main Menu

Young Researchers

Started by Triple Zero, November 12, 2011, 07:36:01 PM

Previous topic - Next topic

Triple Zero

I just wrote this huge comment on HackerNews, answering a guy asking about the best way to teach his 7 year-old son computer programming.

Personally I'm not too sure if 7 years really isn't too young, but he's welcome to try and maybe his kid is like really really clever. I advise him to maybe try and teach him HTML first (which is not really programming), because I know from experience this one 8 year old kid seemed to be able to understand what he was doing (plus he put a bunch of puns on his site, awesome).

ANYWAY I didn't start this thread to discuss whether or how to teach a 7 year-old kid computer programming, but I figured that maybe people would be interested in the story, in which I explain a lot about what I've been doing two days per week the past couple of weeks--in which I also found that indeed I seem to be pretty good with kids :)




Hi! I work at a "Young Researchers Centre", a sort of after-school crafts-and-technology place for kids of roughly ages 8-12. They can work wood carpentry, clay pottery, fabric, metalworks (lots of cute jewelry made from resistors :) ), electronics/soldering, Lego Mindstorms and of course computers. I supervise at the last two.

We don't let them play webgames, YouTube, Facebook or Pokemon websites or things like that, except for the final 30 minutes which is free time (though I still won't let them on Facebook--that's a hairy situation I'll let the parents sort out responsibility over at home. I believe the webfilter blocks it too).

Anyway, what they *can* do: Creating animations with a stick-figure animation program called Pivot, build plain HTML+images websites (with jEdit free syntax highlighting editor that also works over FTP) and create games with the free trial of Gamemaker (GUI-based point-and-click programming, not bad at all). Oh and this afternoon I helped a little guy shoop fake Pokemon cards in GIMP :-)

We *are* looking at introducing a little bit more actual programming into the possibilities, though. I visited this very same centre at the age of ten, and I'd just fire up QBASIC and start coding funky graphics, and there were at least one or two other kids that did similar.

My personal experience is that level of ability varies a *lot* with age, they develop real quick in this age-range. I wouldn't try and teach an 8 year old to program, not even with GameMaker. For some reason kids that age do not yet seem to have developed this hyper-interested bite-your-teeth-in-it persistence (you probably know what I'm talking about if you started coding at a young age--it's amazing, even if the smartest ones are invariably also super annoying clever little know-it-alls, which I try my best to not let get in the way of teaching them :) ).

I did have success with helping an 8 year old kid write his own webpage in HTML. His writing skills were phenomenal for his age, very little spelling errors, just needed to learn proper capitalisation and use of the comma :-) Capitalisation is probably also a result of not yet fully developed motor skills at that age, you can tell that pressing shift with their other hand actually takes them effort. Anyway, he wrote a short introduction about himself and proceeded to write a number of (actually quite funny) jokes and puns. I hope he returns soon, so we can add some styling to the page, it's just plain black-on-white Times with H1, H2 and P tags now.

One important thing we try to focus on here, is to give the kids something to do they can actually finish or at least see some tangible results of within one afternoon. It's really demotivating to be real busy for a couple of hours and not have something bounce around your screen at the end of it, preferably as soon as possible.

Another important thing is, that it's not school. They're not graded and they don't have to do things perfectly, or even the right way. The kids at electronics are soldering wires onto thumbtacks pushed into a piece of soft wood (with a paper printed diagram pasted on it, they make flashing lightbulbs, simple radios etc). It's very easy and it works, but it's not a proper way to do electronics :) In a similar fashion, I'm not going to push them to write properly CSS-ed content-layout-separated semantic HTML. If it's easier and simpler to use an inline style, or *even* a TABLE based layout, I'll show them how to do it. It's more important to show them how to get their hands "dirty" and that they can make these computers do anything they want, I like to show them quick results and they can always learn to do things the proper way later on.

On that note, I realize that PHP is probably the best way to get them started in programming. Most kids can get the hang of HTML pretty quickly (what are the tags for, opening *and* closing tags, how do you make an image, a link, etc). PHP has the nice property that you can just write it *inside* the HTML and easily add a little bit of interactivity, with immediate results. Indeed no templating languages, and yes it *will* grow into a huge tangled mess as they add more and more complexity BUT if there's one young these young kids are very good at, it's keeping track of a tangled mess of their own creation.

A simple example, one kid wrote a multi-page HTML website, with a menu bar (just a line of link tags) on top to navigate. What sucks for him is that he has to duplicate the menu code in every HTML page, and if anything changes or he wants to add another menu-link, he has to edit them all. There's no way to solve this in HTML, except with a FRAMESET which is kinda complex (and very outdated). So next time I will show him how, with a single line of <?php include('menubar.html'); ?> he can make things a lot easier for himself. It's still not real programming, but yet another small step along the way, that delivers immediate results.

Finally, a completely different idea I had, is to show them how to make simple games with Python and PyGame. IMO, Python is one of the best languages to start out with (I suppose Ruby is also pretty great but I'm not too familiar with it), and PyGame is real easy to use as it has functions for images, sprites, timing and even collision detection. I would start them off with a basic skeleton that opens a window and an event loop and possibly some object moving around or something. I'm not really sure whether I'll pursue this idea, because currently the "ease-them-into-PHP" idea sounds better, and I only have so much time to prepare new things :)

So, I can only share my experiences, unfortunately not offer much concrete advice, as we're still trying to figure out the best way as well.

(BTW myself, I started with BASIC at the age of 9. Reasonable beginners language, but it was also the only choice available for me :) )
Ex-Soviet Bloc Sexual Attack Swede of Tomorrow™
e-prime disclaimer: let it seem fairly unclear I understand the apparent subjectivity of the above statements. maybe.

INFORMATION SO POWERFUL, YOU ACTUALLY NEED LESS.

trix

 :jebus:

This I like to read about.  I've tried to get kids in my family interested in computers, technology, or programming, but the attention span I usually encounter lasts about 15 seconds, then their brain seems to go "this is more boring than SPIDERMAN" and they hunt down a TV.  Maybe I'm just a bad teacher.

My uncle gave me his Commodore 64 when I was 11, and since he had no games for it, taught me how to make some.  BASIC is actually pretty easy for an 11 year old to pick up, at least in pure text mode.  I had no problem at all with text games, and had endless hours of fun showing off my text games, right up until my cousin gave me Zork II and I figured out how to get rid of that fucking grue.  Then, of course, nothing else got done until my mom took the disk away.

I think a lot of good is done by learning to think and build in logical, creative ways beginning at a young age.  And I think that, much like learning another language, learning to program young gives the kid an intuitive grasp of nature of programming, and helps them twist what they know how to do in creative ways to get a result they seek.  I remember once writing a god damn near 5,000 line Pascal program just to have it type letters to the screen in colors and with semi-random delays as if someone was typing them as you watched.  Sure, once I learned some advanced looping magic I could cut the program down to 200 lines or less, but goddamn if I wasn't super proud of that simple text animation.  Kids have enthusiasm!  This is a great strength.
There's good news tonight.  And bad news.  First, the bad news: there is no good news.  Now, the good news: you don't have to listen to the bad news.
Zen Without Zen Masters

Quote from: Cain
Gender is a social construct.  As society, we get to choose your gender.

Roly Poly Oly-Garch

Quote from: Triple Zero on November 12, 2011, 07:36:01 PM
I just wrote this huge comment on HackerNews, answering a guy asking about the best way to teach his 7 year-old son computer programming.

Personally I'm not too sure if 7 years really isn't too young, but he's welcome to try and maybe his kid is like really really clever. I advise him to maybe try and teach him HTML first (which is not really programming), because I know from experience this one 8 year old kid seemed to be able to understand what he was doing (plus he put a bunch of puns on his site, awesome).

ANYWAY I didn't start this thread to discuss whether or how to teach a 7 year-old kid computer programming, but I figured that maybe people would be interested in the story, in which I explain a lot about what I've been doing two days per week the past couple of weeks--in which I also found that indeed I seem to be pretty good with kids :)




Hi! I work at a "Young Researchers Centre", a sort of after-school crafts-and-technology place for kids of roughly ages 8-12. They can work wood carpentry, clay pottery, fabric, metalworks (lots of cute jewelry made from resistors :) ), electronics/soldering, Lego Mindstorms and of course computers. I supervise at the last two.

We don't let them play webgames, YouTube, Facebook or Pokemon websites or things like that, except for the final 30 minutes which is free time (though I still won't let them on Facebook--that's a hairy situation I'll let the parents sort out responsibility over at home. I believe the webfilter blocks it too).

Anyway, what they *can* do: Creating animations with a stick-figure animation program called Pivot, build plain HTML+images websites (with jEdit free syntax highlighting editor that also works over FTP) and create games with the free trial of Gamemaker (GUI-based point-and-click programming, not bad at all). Oh and this afternoon I helped a little guy shoop fake Pokemon cards in GIMP :-)

We *are* looking at introducing a little bit more actual programming into the possibilities, though. I visited this very same centre at the age of ten, and I'd just fire up QBASIC and start coding funky graphics, and there were at least one or two other kids that did similar.

My personal experience is that level of ability varies a *lot* with age, they develop real quick in this age-range. I wouldn't try and teach an 8 year old to program, not even with GameMaker. For some reason kids that age do not yet seem to have developed this hyper-interested bite-your-teeth-in-it persistence (you probably know what I'm talking about if you started coding at a young age--it's amazing, even if the smartest ones are invariably also super annoying clever little know-it-alls, which I try my best to not let get in the way of teaching them :) ).

I did have success with helping an 8 year old kid write his own webpage in HTML. His writing skills were phenomenal for his age, very little spelling errors, just needed to learn proper capitalisation and use of the comma :-) Capitalisation is probably also a result of not yet fully developed motor skills at that age, you can tell that pressing shift with their other hand actually takes them effort. Anyway, he wrote a short introduction about himself and proceeded to write a number of (actually quite funny) jokes and puns. I hope he returns soon, so we can add some styling to the page, it's just plain black-on-white Times with H1, H2 and P tags now.

One important thing we try to focus on here, is to give the kids something to do they can actually finish or at least see some tangible results of within one afternoon. It's really demotivating to be real busy for a couple of hours and not have something bounce around your screen at the end of it, preferably as soon as possible.

Another important thing is, that it's not school. They're not graded and they don't have to do things perfectly, or even the right way. The kids at electronics are soldering wires onto thumbtacks pushed into a piece of soft wood (with a paper printed diagram pasted on it, they make flashing lightbulbs, simple radios etc). It's very easy and it works, but it's not a proper way to do electronics :) In a similar fashion, I'm not going to push them to write properly CSS-ed content-layout-separated semantic HTML. If it's easier and simpler to use an inline style, or *even* a TABLE based layout, I'll show them how to do it. It's more important to show them how to get their hands "dirty" and that they can make these computers do anything they want, I like to show them quick results and they can always learn to do things the proper way later on.

On that note, I realize that PHP is probably the best way to get them started in programming. Most kids can get the hang of HTML pretty quickly (what are the tags for, opening *and* closing tags, how do you make an image, a link, etc). PHP has the nice property that you can just write it *inside* the HTML and easily add a little bit of interactivity, with immediate results. Indeed no templating languages, and yes it *will* grow into a huge tangled mess as they add more and more complexity BUT if there's one young these young kids are very good at, it's keeping track of a tangled mess of their own creation.

A simple example, one kid wrote a multi-page HTML website, with a menu bar (just a line of link tags) on top to navigate. What sucks for him is that he has to duplicate the menu code in every HTML page, and if anything changes or he wants to add another menu-link, he has to edit them all. There's no way to solve this in HTML, except with a FRAMESET which is kinda complex (and very outdated). So next time I will show him how, with a single line of <?php include('menubar.html'); ?> he can make things a lot easier for himself. It's still not real programming, but yet another small step along the way, that delivers immediate results.

Finally, a completely different idea I had, is to show them how to make simple games with Python and PyGame. IMO, Python is one of the best languages to start out with (I suppose Ruby is also pretty great but I'm not too familiar with it), and PyGame is real easy to use as it has functions for images, sprites, timing and even collision detection. I would start them off with a basic skeleton that opens a window and an event loop and possibly some object moving around or something. I'm not really sure whether I'll pursue this idea, because currently the "ease-them-into-PHP" idea sounds better, and I only have so much time to prepare new things :)

So, I can only share my experiences, unfortunately not offer much concrete advice, as we're still trying to figure out the best way as well.

(BTW myself, I started with BASIC at the age of 9. Reasonable beginners language, but it was also the only choice available for me :) )

BASIC's still one of my favorites. I do all of my scripting with Visual Basic. Problem I had starting out with BASIC at such a young age is it made the leap into subs and functions and OOP kind of difficult. I was immersed in BASIC before I ever even looked at quick-basic, pascal or anything that wasn't line-numbered, goto heavy and very easy just to linearly play with. To this day I occasionally run across situations where I literally freeze for hours on end looking at a loop and trying to get around a goto.
Back to the fecal matter in the pool

Triple Zero

Quote from: trix on November 13, 2011, 12:48:27 AM
This I like to read about.  I've tried to get kids in my family interested in computers, technology, or programming, but the attention span I usually encounter lasts about 15 seconds, then their brain seems to go "this is more boring than SPIDERMAN" and they hunt down a TV.  Maybe I'm just a bad teacher.

Well there's the thing that there's a lot of kids and the ones I teach/explain are the ones that chose for themselves they want to learn it. If the kid thinks <doing creative stuff> on a computer is too boring, they're welcome to try their hand on the legos, electronics or wood working.

Speaking of <creative stuff>, while the official current focus is on programming/programming-like activities, I personally think the creative aspect is most important. If the kid wants to run Word and start writing their own fairytale story, that'd be fine with me (fairly awesome, actually). Which is why I helped the other kid shoop the Pokemon card, I noticed he was kind of slow and confused (was later informed he has autism--but not the kind that makes you a computer whiz), so helping him step-by-step editing a picture in GIMP, with immediate visual feedback, already was quite a challenge taxing his abilities. He was absolutely thrilled when he finished his Level 28 HP 70 Pikachu :D

QuoteMy uncle gave me his Commodore 64 when I was 11, and since he had no games for it, taught me how to make some.  BASIC is actually pretty easy for an 11 year old to pick up, at least in pure text mode.  I had no problem at all with text games, and had endless hours of fun showing off my text games, right up until my cousin gave me Zork II and I figured out how to get rid of that fucking grue.  Then, of course, nothing else got done until my mom took the disk away.

:lulz:

QuoteI think a lot of good is done by learning to think and build in logical, creative ways beginning at a young age.  And I think that, much like learning another language, learning to program young gives the kid an intuitive grasp of nature of programming, and helps them twist what they know how to do in creative ways to get a result they seek.  I remember once writing a god damn near 5,000 line Pascal program just to have it type letters to the screen in colors and with semi-random delays as if someone was typing them as you watched.  Sure, once I learned some advanced looping magic I could cut the program down to 200 lines or less, but goddamn if I wasn't super proud of that simple text animation.  Kids have enthusiasm!  This is a great strength.

Yeah I did very similar things, textmode linenumber BASIC, we didn't have colours though, it was just your oldskool glowing green CRT monitor (probably real tiny compared to modern day screens as well).

I got the looping down pretty quickly (probably because my first program I copied from a newspaper was of the 10 PRINT "some text"\n 20 GOTO 10 variety), but would you believe I did not know the SAVE command at first? :lol:

This one time I made this awesome program which was basically a combination of four things I had written before with a "choose 1..4" menu in front of it. It had a "higher/lower guess the random 1..100 number game" (who knew binary search could be so exciting :lulz:) and a "print / - \ | / - \ |  characters, goto 10 effect", that would fill the screen with spinning line characters (that's right I wrote my very first demo effect at the age of 10 ;-) ) and two other things I can't quite recall. It was a sad moment, letting go of the power switch later that afternoon :) [though I was already planning my awesome improvements for "next time", even if I had to write everything again].

Good thing I shortly thereafter learned the SAVE command, after writing a letter to the computer column guy of a kids science magazine, asking for help with BASIC programming. He replied to me with a small stapled xerox copy of a BASIC syntax/command reference, which was actually for a different brand computer but most BASIC commands were the same. Most importantly the SAVE and LOAD commands :)
Ex-Soviet Bloc Sexual Attack Swede of Tomorrow™
e-prime disclaimer: let it seem fairly unclear I understand the apparent subjectivity of the above statements. maybe.

INFORMATION SO POWERFUL, YOU ACTUALLY NEED LESS.

Golden Applesauce

I learned BASIC at about that age.  Except I'm younger than most of you (just got out of college a few months ago) so I got to learn BASIC with a program imaginatively called "Learn to Program BASIC".  It had a bunch of lessons where they'd give you a starting program that you (with the help of some amusing cinematics and colorful characters) would improve with the language feature of the day.  Things like "here's a program that does a thing ten times, but that's really boring, so now we're going to do that same thing ten times using... <dun dun dun> A FOR LOOP!" followed by an informational clip where ActionMan explains what a for loop is and how to use it.  Only it'd be framed as ActionMan being a git-off-mah-lawn geezer complaining that the whippersnappers of today were spoiled because they could just use a for loop to do something 100 times in a row really easily.

It had a built-in GUI and sprite library, so it was really easy to do stuff like "move an astronaut across the screen."  I made a game where the object was to move the mouse from one corner of the screen to the other without touching any of the pink paint that was spreading across the window.  Collision detection was a simple "Is the pixel under the mouse cyan (safe) or pink (you explode!)".

It also had about a dozen built in games that you could play after completing all of the lessons.  Since everything ran in the IDE, you could edit the source code for the games directly - so you could give yourself 100 lives, make all the bullets move twice as fast, free the space invaders from their "cross the screen, go down one row, go the other way, repeat" track, etc.

I don't think it runs on modern OSes though, so I'm getting my young cousins The Logical Journey of the Zoombinis for Christmas instead.
Q: How regularly do you hire 8th graders?
A: We have hired a number of FORMER 8th graders.

trix

Sometimes I think as adults we forget the kinds of things that excite a kid.  I see so many programming-for-kids things that take away the structure of programming to have them concentrate on the "change this variable and see the effect in the game right away!" flashy changes.  But I clearly remember my most exciting times being stuff that many people would think should bore a kid, like when I first discovered INPUT A$ and all the possibilities that entailed, I cancelled a birthday trip to Chuck-e-cheese for that one, because I really really wanted to stay home and lock myself in my room and write a ton of "What is your name? ", "Hello, <name>!" type programs.  Or, much later, as the guy above me mentions, for loops!  Figuring those out was fantastic!  Or in Pascal, the repeat; until x loops.  Actually seeing the effects on the screen was just the visual reward for all the typing, but the exciting part was actually learning the powerful tricks!  Well that, and going from the 2 color C64 to the 16 color ancient Mac that I learned Pascal on.  Followed by the IBM PS/2 with 256 color DOS+Windows 3.11 and the 14-disk copy of DOOM.  Hellooooo Nostalgia!

Nowadays I find it difficult to find the time and willpower to teach myself Python, even though I really want to learn it.  But with my college classes getting so hard, I get done with my homework and all I feel like doing is reading forums and finding new ways to break my Gentoo install.  Oh to have the little-kid excitement again.
There's good news tonight.  And bad news.  First, the bad news: there is no good news.  Now, the good news: you don't have to listen to the bad news.
Zen Without Zen Masters

Quote from: Cain
Gender is a social construct.  As society, we get to choose your gender.

Golden Applesauce

You know what's cooler than a program that asks for your name, then greets you with it?
A program that greets you with your name spelled backwards, once for each letter in your name.  Unless the name is your little sisters name, in which case it calls the user a stupidhead.

The change-a-variable-to-change-the-game thing was really about the least interesting thing you could do with the built-in games.  I think they were there to give the kids the confidence that they could change a line of code in this scary program that does all these complicated things without ruining everything forever.  The games themselves were really there to present design patterns - if you wanted to make a game where you shoot things, you could look at the example games to see how they went about making bullet sprites on mouseclick, or if you wanted to make Zork, you could see how the example texty game used data to store which rooms linked to which other rooms, etc.

I do agree that mature programmers run the risk of losing the fun/discovery style of learning.  When I'm doing things on my own, I'll make little goofy programs that use whatever library I'm figuring out how to use - but when you're working on a real project in a team, it's very much a "scan the documentation for the NuGet package until you find a function named like what you're trying to do then see if it runs right" process.
Q: How regularly do you hire 8th graders?
A: We have hired a number of FORMER 8th graders.

Triple Zero

Quote from: trix on November 13, 2011, 07:24:25 PM
Sometimes I think as adults we forget the kinds of things that excite a kid.  I see so many programming-for-kids things that take away the structure of programming to have them concentrate on the "change this variable and see the effect in the game right away!" flashy changes.  But I clearly remember my most exciting times being stuff that many people would think should bore a kid, like when I first discovered INPUT A$ and all the possibilities that entailed, I cancelled a birthday trip to Chuck-e-cheese for that one, because I really really wanted to stay home and lock myself in my room and write a ton of "What is your name? ", "Hello, <name>!" type programs.  Or, much later, as the guy above me mentions, for loops!  Figuring those out was fantastic!  Or in Pascal, the repeat; until x loops.  Actually seeing the effects on the screen was just the visual reward for all the typing, but the exciting part was actually learning the powerful tricks!

True enough. I think that's one of the reasons why I'd like to try and see if we can move from GameMaker to Python+PyGame. I don't think it's that much harder, maybe a little bit.

But I can imagine that the "cool tricks" you described might appear as boring hurdles in GameMaker, as you pretty much select them from a drop-down or a collection of "action" and "event" icons, which you drag on a sprite-object.

Now I don't consider "visual programming languages" less than text code based ones, whether you have keywords or icons+diagrams, you're building the same sort of structures.

Except in GameMaker I feel it might be a problem because you use the "cool tricks" always for a pretty limited set of typical game-logic problems. I trust that when you get down to it, GameMaker will probably be generic enough that you still could use them in different ways, but you're just not driven to it. So the "cool tricks" become boring hurdles that just stand in the way of something a kid may (rightfully) wonder about why the program doesn't just let him draw a 2D platform level in Paint and have his "guy" jump around in it. And there's actually no reason why it couldn't. Except for specifying things at a lower level so it's more like programming. They could just as well have put those game mechanic hurdles in as presets and then have the kid tweak them if they need to do something out of the ordinary.

QuoteNowadays I find it difficult to find the time and willpower to teach myself Python, even though I really want to learn it.  But with my college classes getting so hard, I get done with my homework and all I feel like doing is reading forums and finding new ways to break my Gentoo install.  Oh to have the little-kid excitement again.

You should. Go learn Python. Python is awesome :) If you get stuck or want some advice on the best way to do it, feel free to PM.

Speaking of Python+PyGame, go get it. I'd advice you to install Python 2.7.x, not 3.0. Even though v3.0 is really awesome and the way of the future, one thing that makes Python so powerful is the huge amount of libraries and modules written for it, and a lot of the must-have best ones are still not quite done porting to 3.0.

When you installed Python, get PyGame: http://pygame.org/install.html

When you've done that, check this out:

side-scrolling game with high scores, a dynamic, parallaxing background, procedurally-generated landscape and sound effects, all within 1024 bytes of Python code

Yeah I know that's not going to teach you much Python because it's highly minified ugly code with single-character variables, etc. But it does show you just how little code and how incredibly easy it is to make a simple side-scrolling platformer with PyGame.

Good luck :)




Quote from: Golden Applesauce on November 13, 2011, 08:33:45 PM
You know what's cooler than a program that asks for your name, then greets you with it?
A program that greets you with your name spelled backwards, once for each letter in your name.  Unless the name is your little sisters name, in which case it calls the user a stupidhead.

Oh yes, absolutely :lulz:

(except I have a brother)

QuoteThe change-a-variable-to-change-the-game thing was really about the least interesting thing you could do with the built-in games.  I think they were there to give the kids the confidence that they could change a line of code in this scary program that does all these complicated things without ruining everything forever.

I dunno man, I hacked the everloving fuck out out GORILLAS.BAS, even though IMO it was always a bit too big and complex to fully understand the entire program.

Ex-Soviet Bloc Sexual Attack Swede of Tomorrow™
e-prime disclaimer: let it seem fairly unclear I understand the apparent subjectivity of the above statements. maybe.

INFORMATION SO POWERFUL, YOU ACTUALLY NEED LESS.