DEV Community

loading...

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

andyhaskell profile image &y H. Golang (he/him) ・1 min read

What languages/technologies would you use, what concepts would you start with, and how would you make it fun for past-you?

Discussion (3)

pic
Editor guide
Collapse
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 code.org, 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.

Collapse
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

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

For myself, I got into coding in 2005 through ActionScript in Flash, trying to make a play button for my cartoons. I went between different tutorials, and tried some of everything without learning the concepts by name.

I think since you can do cool stuff without even coding, and you can invite friends over who know how to draw, I think given it's 2002, Flash is still what present-me would use to teach past-me, and I'd just let my past self discover the concepts by bumping into them and only use what I know from coding on the job when past-me is bouncing ideas off present-me. Today too, I still learn best by experimenting witn the world I'm building in, and when I'm going into learning a concept with an idea of what I'd do with it.

If past-me met present-me in 2020 though, probably instead of Flash we'd use something like p5.js or the Arduino starter kit I got for Christmas. I know in 4th grade I got way into the unit on electric circuits!