DEV Community


Discussion on: You timetravel to when you were a kid, and past-you wants to learn to code. How would present-you teach them?

practicingdev profile image
Practicing Developer

Given that I've got kids who are now just getting interested in coding (5 and 7 yrs old), I'm taking the approach of letting them play with all sorts of different things.

Whether that's doing a bit of Logo-like programming using a toy robot like Artie 3000, messing around with games in Pico-8, trying the various projects on, or doing a bit of HTML, CSS, and Javascript on Codepen, it's a mixture of them just trying stuff and me giving them help when they ask.

I am explicitly not trying to make them follow formal lessons, nor am I teaching them in any level of detail the various structures and semantics of languages. Instead, we nearly always start off with an existing program of some sort (whether I wrote it or we found it elsewhere), and then I show them where the variables and functions are that they can tweak stuff in.

When I first started (around their age), I had learned similarly but without the benefit of someone guiding me. I had typed BASIC programs in from printed books which I did not understand at all, but then I started noticing the various names, symbols, and numbers. I would play around with those, and then see something change on the screen (usually something would break, but sometimes it wouldn't) and that would always be fascinating to me.

I think that similar to human languages, you kind of need to "speak the language of code" before you can actually learn to properly write long programs and know what the precise rules are. It is amazing how good young kids are at this, because they are brilliant pattern matchers.

I also find that kids can pretty quickly get the concept of a function even if they have a simplistic understanding of it. I usually tell the kids, "I wrote a function to teach the computer how to make a zombie, and now you just need to type makeZombie and a couple of numbers to tell the computer where to draw the zombie on the screen) -- repeating this for pretty much every concept drives it home pretty quickly, and now they're pretty quick to ask me "Can you help me write a function that does ThingX?"

Sure they can still get frustrated or bored at times. But when they think of writing code as just being another way of "playing something", I think it's a huge win. And as they get older, I can teach them more practical applications because they will already have a decent amount of experience.

andyhaskell profile image
&y H. Golang (he/him) Author

Really insightful! I really like when STEM teaching, and really any kind of teaching, "lets kids be kids". I know for me when I was learning ActionScript, I didn't know objects were a thing, I just kinda found them because I had too many variables to keep track of characters' stats in an RPG I was making in Flash. Then when I took CS in high school (Java) I cruised right through when I got to put a name on the coding concepts I discovered a few years before

Forem Open with the Forem app