Teaching our five year old to code by cheating
baugues.com
baugues.com
#!/usr/bin/perl
$score = $ARGV[0]
if ($score > 90) {
print "A";
elsif ($score > 80) {
print "B";
elsif ($score > 70) {
print "C";
elsif ($score > 60) {
print "D";
} else {
print "E";
}
And I'd ask, "What do you think happens if you put in '85'? What about 10000? What about -30?" If the group I was talking to seemed pretty sharp on the uptake, I'd ask, "If you wanted to hack it so that people who got 95 got an E, and people who got 50 got an A instead, what would you do?"The kids really seemed to enjoy that. Apparently they even told the teachers I was teaching them to hack programs -- a bit concerning for the teachers, but mission accomplished as far as I'm concerned.
“Hey kids ready to do some super exciting math in a computer program?” Nah.
I had a computer teacher who managed to make me bored and disinterested with stuff like this, despite me being crazy crazy crazy interested in computers.
The best way to teach kids programming is via programmable graphics I.e visual games making systems. Not written code.
Kids like to play games, so creating their own game is a problem they will likely care about. If they spent past 10 hours trying to advance to the next level, then showing them how to hack their way to the next level is probably going to get them excited. If they are stuck in a system where everyone's focus is on their grades, showing them how to hack that system will likely get them excited. Even if it involves doing some math.
"Hey kids ready to do some super exciting graphics with turtles in a computer program?" Nah.
I had a computer class based on Logo that managed to make me bored and disinterested with stuff like this, despite me being crazy crazy crazy interested in computers. Then as I got older I actually did get into graphics and gamedev, but early on it nearly killed all interest for me.
The best way to teach kids programming is by making sure the kids are engaged, whatever they enjoy doing.
Just as for some, Perl is pleasure, for others, Perl is pain.
And although I wouldn't call this exercise "fun", it's something that connects with a part of their life they understand. Nobody would actually write a script like this, but someone could totally write a function like this as part of a larger program, and have exactly the kind of "bug" that was displayed there; or, could be hacked in exactly the same way.
Kids are sharp enough to know when a skill is going to be useful, even if it's not "fun".
Kids are also a lot less dependent on fun than people think. If they actually feel useful you'd be surprised what they're interested in doing that's not considered fun.
That’s not Logo, that’s the teaching. The whole point of Logo is that it should be 99% self-taught. The teacher’s job is to teach the bits that aren’t naturally discoverable (see my three steps above), and to offer hints and nudges towards rich new areas for exploration should they bog themselves down in old, crude inefficiencies and repetitions.
Bad Logo teaching is making kids memorize what all the buttons are called and what each one does when you push it, of setting “problems” that have one right answer which the student must return or is penalized for being wrong.
Yes the “turtle” was limited, and if all you ever did was draw “turtle graphics” with it then, yeah, you’d quickly grow bored.
But being limited to turtle drawing only was a limitation of the hardware and software of Papert’s time, plus the inability of most adults—particularly those in charge of the purse strings—to see the need to expand that platform to provide other opportunities as well. That damned turtle should’ve been just the first of a myriad of Logo “expansion packs”, but those damned grown-ups couldn’t see that because they lacked the imagination to do so. (Though if they had, they’d have been terrified by the thought: creating kids who think for themselves and can run circles around them—inconceivable!)
Because all those adults saw Logo as was just another hoop to teach students to mechanistically jump through in rote-taught lessons before putting it away and moving onto teaching the next hoop, not as an open-ended user-led tool to be put in the hands of the kids so that they can explore and experiment and teach themselves while pursuing whatever it is that is of interest to them.
That’s the worst thing about authoritarians: all they ever want to do is to make more of the same.
No, it's logo, because we were taught in exactly the manner you describe, to the letter. In fact I might have enjoyed it more if there were more structure.
I hated art class as a kid, and turning computer lab into art class was not something I was ready for back then. At the time I was laser focused on wanting to learn to program, and I saw logo as something different than programming.
You're using this as a weird segway to rant about authoritarians, but you're also telling me that there's a single way to teach kids programming that everyone needs to adhere to, and anyone who doesn't like it was taught wrong. Seems a bit tone deaf.
Some kids love my robotics classes using MakeCode or MicroPython. Some kids love my data science classes with Python and SQL (I doubt anyone loves the Excel formula :P). Some kids love writing games in Scratch or MakeCode Arcade. Some love writing MakeCode in Minecraft EE. The one thing they all have in common is there are always kids who get turned off by the environment we're using.
I love it
Worked well for me — I aced all the C and C++ computer science papers all through 100/200/300-levels at University.
Some kids do like the puzzle aspect of things. And specifically small exercise like this can be fun or not for kids who normally dont like puzzles, if you create the right mood.
The differences were just that I used Python rather than Perl and the program was a higher / lower game:
from random import randint
random_number = randint(1, 100)
guess = 0
while guess != random_number:
guess = int(input("Guess a number: "))
if guess > random_number:
print("Too high!")
if guess < random_number:
print("Too low!")
if guess == random_number:
print("You win!")
(there's obviously a lot of ways you'd write this as better code but the point was to teach the absolute basics)So the basic concept of the program is essentially the same (command line based and integer comparisons) but it's structured as a game. I too encouraged the kids to hack their programs and they loved it! In fact at every stage of the class, from teaching how strings work (eg below)....
name = input("What is your name? ")
print("Hello " + name)
...to the completed game, I gave kids time to hack the code and adapt it how they wanted. Kids genuinely loved it. They'd put silly code in as jokes and found it hysterical that the computers repeated their silly code etc. They were very much engaged.Obviously there will always be outliers who don't enjoy those types of lessons -- I mean everyone is different after all. But this kind of structure for teaching code is actually very effective for engaging the majority of the class.
From there I made guessing games and text based rock paper scissor games and stuff. I didn't get into any kind of graphics programming until I was older.
Just being able to tell the computer what to do and make things happen with words on the screen was what got me fascinated with programming.
I had a blip of a realization one day when idly talking to the 6yr old with a prolog terminal at hand. Documented that here - http://sriku.org/blog/2019/07/16/prolog-is-magic/
I've also heard good things about "ro blocks", but having watched a stream or two I'm less sure of it as a good introduction.
Computercraft turtles and LUA aren't terrible, but when I see a FOR loop I think C style, while LUAs is the other kind and I'd really love for that for to be named something like ITER instead.
(I would recommend playing a bigger modpack where ComputerCraft is included)
In general I think starting from nothing is the original sin of programming pedagogy. I think it's easier to learn by example, imitation, and extension and then learn the deeper principles once you need them.
My wish is a game that would be compelling enough to get a few app store downloads but allows for live editing of the source. Say a soccer game where you can start by changing configuration options like the ball color, then maybe you can find where goals are added in and make yours count for more, eventually basic physics like changing acceleration.
Probably not for 6 year olds, but even at the college level I'm not sure about having students start by staring at an empty editor window.
I think you're right in saying that. Back when I was in school, I learnt a lot by copying BASIC programs from mags and typing them in and then modifying them. I don't think I even acknowledge that early stage much now given that learning strategies have evolved from there.
edit: Thinking back to that, it seems to me that one of the attractive aspects of BASIC for interactive programming was line numbers. You could replace any line by typing a fresh line with the target line number instead of going back to edit the program. There's something innocent and simple about that.
The line numbers definitely help you imagine the computer mechanically reading and executing the lines. I wasn't taught with BASIC so in the few times I've had to modify a program with meaningful line numbers I have often used make or similar to just put them in for me. I'm glad someone likes them, I never understood why they existed!
I think what's left is building it more or less. Also structuring the code for education. For instance keeping the complicated, scary code out of files that will be modified early.
The team's work with Bootstrap (https://www.bootstrapworld.org) is actually pretty awesome .. where they're trying to accommodate even kids who may not have access to a computer. One of the best CS educational efforts I've come across. Check out racketcon2020 ( https://con.racket-lang.org/) where Kathi Fisler (co-founder of Bootstrapworld) is keynoting on "data centric computing".
Trying to make kids learn programming without them being interested is about the parent wanting their children to be like them.
If I'm right, OP is either ahead of the curve or jumping the gun, depending on your perspective. :)
Most parents introduce kids to things they themselves like or value. Like, sport, reading books, music, video games, nature, shows they themselves like and so on. People do it even with math and grammar (through I was never able to fully understand the grammar thing). The list is pretty long and the more parents you know, the more normal it seems to be to show your kids what you yourself like soon.
I think at 5 years old I played some educational games that my parents had (I can't even remember the names..) and I was lucky that we had a computer because that wasn't common in the early 90's.
I learned a lot about computers from trying to cheat at games though - whether it was hex-editing to get around CD-ROM checks, or memory/packet editing to cheat in the games themselves. I guess mischief and breaking things is attractive to children.
That's harsh. I'd say it's about introducing their children to something they enjoy/find valuable, in the hope that the kid will enjoy it (or get value from it) too
We're just trying to meet him where he is at and try to make sure he is being creative, whatever it is.
The foundational mistake is “teaching programming”. The goal should be to instill (“teach”) critical thinking and analytical problem solving skills, and a “programming environment” just another tool, like pencil and paper, which the student can use when exercising those skills on real-world problems.
Whereas “teaching programming” is teaching language features: what all the buttons are and what they do when you push them. Thus mastery of button-pushing becomes feted as the end-goal of itself, instead of being just some tiresome but necessary tool-practising crapwork (like memorizing the ten-times tables and drawing all the letters from A to Z) that you have to go through on the way to achieving your true goals (which can be anything).
Once again, I point to Papert’s Logo[1] as a good demonstration of just how simple that PE can—and should—be to serve that purpose. Logo’s core concepts can be communicated in just three steps:
1. This is a Word.
2. This is how you Perform words.
3. This is how you Add your own words.
Anything else that the platform provides, such as its dictionary of pre-defined words, can and should be explorable and discoverable; something today’s hardware and software can support and encourage without blinking. Let the students teach that crap to themselves if/as/when they need it, and keep the adults on hand just to observe when students start running themselves down a dead-end and prompt them to other possibilities they had not realized/considered.
Oh, and it really should go without saying that the PE’s error messaging must be the top of their class. Because errors aren’t the “wrong answers” of which a student should feel embarrassed and ashamed, but fresh questions in their own right which spark awareness, exploration, self-correction, and insight.
--
[1] https://www.amazon.com/Mindstorms-Children-Computers-Powerfu...
I've tried to encourage my little (he's 21 now) brother to get into programming, but he's just not interested. I'm disappointed, but that's my problem, not his. He's had every opportunity to get into it. He's got his own computer and a big brother willing to teach him. If he wanted to do it he would've done it.
My other brother became a mechanic despite nobody encouraging him to do it, nor providing him with the resources when he was younger. He had to go out and find old lawnmower engines to work on by himself. He was actively discouraged from bringing home junk by our parents, but he did it anyway.
The vast majority of people do not want to become programmers. The best thing you can do for children is to expose them to as many things as you can. Take them to museums. Involve them in your hobbies and your friends' hobbies if possible and if they want to. You'll know when they've found what they want to do.
Also, don't be disappointed if girls just want to be mothers. It's one of the most important and noble jobs there is. Don't discourage it because you don't think it's as important as what you do.
To the GP, if it's OK for girls to "just be mothers", is it then OK to describe a woman as "just a mother"?
I have a daughter. I suspect that if she becomes "just a mother", what that really means is her skills and interests are so foreign to me that I can't come up with a better description than "just a mother". And I hope that I will not be OK with that.
You need to stop treating everyone in the world like a member of your scrum team or something. Understanding people's "skills and interests"? They're just people for crying out loud, speak to them. And no, there's nothing wrong with being "just a person". Stop being so analytical and desperate to have everything conform to your fantasies of what the world should be like.
Like in the original comment this started with "girls just want to be mothers" is contrasted with being a person who has any out of parenting interests at all.
And for all the talk about "noble", no interests at all leaves you with nothing to think about, nothing to talk about, nothing to do, nothing to be happy about when children are not present. Nothing to be proud about once the kids are not toddlers anymore and their achievements are their own.
Speak for yourself. Sounds like projection to me.
Do you have children? Parents can be very proud of their children's accomplishments.
And parent "living exclusively through childrens achievements" is object of criticism. That situation is not good for children, because they end up being pushed into parents dreams. It is unfair to children to expect them to be your source of proudness or whatever.
This!
Also, focus on removing obstacles to learning, rather than pushing them to learn.
The best way to get a kid interest in music is to keep a second hand guitar lying around (tuned, what a coincidence) on the couch. The next best thing is to play yourself from time to time.
Everything else is just noise.
How is that any different then "and show them also some programming"?
Generally I find a lot of my interests align with my parents, but I always had to discover a passion for them on my own.
He's now 13 and is programming every chance he gets - but because he came to it himself, I think he enjoys it more.
The OP isn't taking his daughter through a coding course, just showing her that cool things are capable via coding. What could be wrong with that?
Another thought: when ML starts getting applied to solving programming (see recent GPT-3 demos for many examples), do you think by the time that 5 year old is 20, programming will still be a viable career for humans?
I think people will always learn math, programming, and natural languages for fun and intellectual growth, but I don't see those being paying jobs in 2 decades, when AI will be vastly superior to us.
For example, think about how many millions bugs are because of the most basic of human errors, time and time again, and the huge costs associated with that.
There was a time when you probably could have said the same thing about reading.
I'm not talking about programming as a career. Much like reading and writing, you can have a career focused around it, but it has applications in non-technical careers.
Many jobs have repetitive tasks. I've personally had jobs in my life where lots of aspects could be handled by scripts (although I didn't know how to write them at the time). Additionally, a lot of workplaces rely on Excel for key workflows that would be simpler and faster as programs. Computer literacy, much like writing, opens doors. The vast majority of people who learn how to write are never employed as professional writers.
Additionally, like reading and writing, it can be a great source of pleasure. Much like the author, I make little games for my daughter to play on (https://letter-press.netlify.app/snek/ for example). You can create art with code, or treat it as a puzzle solving exercise, or use it to modify your favorite games.
> Kids should be taught programming when they express an interest
If we felt this way about other subjects, we would never teach 95% of kids math, or 50% of them how to read.
edit: the best outcome is that they might love it, and if they do will probably end up far better than you at it, and will make a trustworthy business partner once they reach adulthood.
if int(guess) == lulu + boonie:
instead of if guess == lulu + boonie:I record this for people who might want to try this with kids around 10 years old:
I made a game with my daughter, according to the .apk date it was 5 years ago so she was 10.
I started by making a project in android studio. Then a gameloop, where you had one function for drawing and one function for handling clicks/screen presses. So when you pressed 'play' on studio, it opened an 'empty game' on her own phone. All you had to do to make a game, was to edit 2 different functions and to make variables to pass info.
After that we started coding together and I no longer touched the keyboard. I just asked what she would like to do next, and gave advice how it could be done. She had patience for about 15 minutes at a time, and after of total maybe 2 hours, calendar time 4 weeks, we finished a 'hit a mole' game. I was quite careful not to put any pressure like 'lets do a bit more'. And asked maybe twice a week, 'would you like to do some coding'.
After the project she said it was 'not her thing'. This summer she was coding web-UI with Java+IntelliJ in my work as a summer trainee, and now she said she enjoyed it.
Her first instinct was not wrong. I’ve been coding 20 years now (self-taught automator who turned pro after the first 10), and though I absolutely love what programming enables me to do I still despise the amount of hostility and crapwork that “popular” modern programming platforms put me through in order to do it.
I hope your daughter goes on to achieve whatever she wants to achieve, and if that should be programming I hope she never forgets that early distaste, because that is the only thing that will drive substantive improvement in a culture and industry grown fat and complacent on the sorry status quo.
--
“The reasonable woman adapts herself to the world: the unreasonable one persists in trying to adapt the world to herself. Therefore all progress depends on the unreasonable woman.” ― George Bernard Shaw (paraphrased)
https://store.steampowered.com/app/1226170/Forest_of_MATH/
Of course, the game itself is meant for him (and other kids) to play and practice basic math.
I hope he'll get to program his own games in a couple of years.
I can't imagine how he could start to learn programming at this age.
Don’t. Instead imagine a computing environment that facilitates the basic reading and math skills he’s now attempting to practise.
Age 6 is a bit young, but by age 8 a child starts developing the capacity for abstract thought, which enables them to turn those rote-taught skills into useful practical tools which they can apply to the problems that they themselves want to solve.
Again, go read Papert’s Mindstorms. It is worth their weight in gold, if/once you can understand it yourself.
She was watching closely and asked about important details of it. She saw that "if you don't have what you need, you can make it yourself".
Programming isn't everything. Having the confidence to make the world into what you want it to be is. If programming gets you there, fine. If art, poetry, activism, or welding get you there, so much the better!
How did you pitch the idea of coding with her? While I don't have children yet, I love the idea of coding together with them, but I'm not sure how to get them to do it. Especially with minecraft and other way flashier options available to them.
And yet.
We have been doing videogames together. (Maybe spent 4 or 5 hours total, distributed in several months. I don't want to overwhelm him or anything).
I found that pico-8 is an excellent platform for doing this kind of collaborative thing. I can do the programming (for now) and draw basic sprites (for now). He's the art director, and provides game design ideas. It's fun, although he gets frustrated when I am "writing" too much time. But I think the idea that "games are made out of letters and graphics" is already permeating into him. I would love to teach him the programming part, but I will wait for him to express some interest on it first (after he learns how to read). If he prefers the graphics (or doing something else) that's fine too.
Glad to discover he got back to writing recently.
so many overdeveloped, hyper-real, dopamine-avalanches fighting for their attention--good luck getting them to pay attention to mere reality after that. especially when mere reality has to be introduced in baby steps.
I teach my daughter programming in Scratch and it much easier. The fact that she can record sounds and draw her on characters are just some of the aspects that make Scratch appealing.
Addons like MakeyMakey make it more interactive.
There ... I fixed it.
`if guess == str(lulu + boonie):`
print(" !!!!!!YOU WON THIS GAME !!!!!!")"
;)