Of Course Kids Can Code. I Did.

There’s a highly-rated comment on Reddit right now describing how third-graders can’t write real program code. That’s horrendously wrong, not to say condescending. I know for a fact that third-graders can code: by third grade, I was writing self-modifying 6502 Assembler code.

I’m tired of seeing grown-up people claiming kids can’t do this and can’t do that. Most of the time, it’s hogwash. Every time I’ve put a young person to the test, they have aced. I’ve put 17-year-olds on national television to explain complex policies, and they shine.

But when it comes to coding, and a claim that 3rd-graders can’t write real, executable code, I just get plain angry. I coded by 3rd grade. Don’t tell me the coding tools haven’t improved in the 30 years since then.

By first grade, I was typing program listings off of magazines. This was not just before the Internet, it was before any kind of digital communication, and most computer programs were so short you could fit their entire listing in a few pages. Therefore, people did just that. A lot of them were games – running in text mode, of course: there was very little graphics to speak of. This is when I started learning ASCII codes: CHR$(42) was an asterisk, and 60-61-62 was the sequence of “<=>”. That was used for a very primitive Space Invaders clone called Tank vs Ufo in text mode.

Of course, like any curious kid, I changed things here and there in the listings to understand what effect my changes had. That’s how I learned to code in BASIC.

By third grade, I was writing self-modifying Assembler code. The 8-bit computers of the day weren’t very helpful in accomplishing the most basic of tasks. To clear the screen, you had to create a loop that wrote spaces to the entire screen memory, but a loop could only index 256 bytes (8-bit code, remember?) and the screen was larger than that. Therefore, you had to change the executing code’s index base to move it forward 256 bytes and re-run the loop as part of the execution itself, until you had rewritten the entire screen buffer with spaces.

So the self-modifying Assembler wasn’t so much a cool hack, as it was the way you had to write to make something remotely interesting happen.

I never fell in love with Assembler, though. It just took me much too long to get anything useful done.

By fourth grade, I was coming up with sorting algorithms. I needed to sort a large set of strings for a school assignment, and didn’t want to do it by hand, so I wrote code to do it for me. I still remember my thinking: you’d first find the element to go at the top of the finished list, and put it there, then find the element to go second in the finished list, put it there, and so on. To find the element you wanted, you’d iterate over the list backwards, swapping places for two elements if they were out of order. That way, on the first iteration, the first element was guaranteed to come all the way to the top, no matter where it had initially been, and so on for the following iterations. I remember realizing that I could limit the subsequent iterations to not cover the part of the list that was already sorted (as in, it was unnecessary to re-check the first already-sorted element on the second and onward traversals).

I learned much later that this method is called Bubble Sort. I came up with it in fourth grade. It worked well for a small set (but, as I would later teach at University, it sucked for any practical application).

By fifth grade, I had written my first database. We were copying a lot of games between one another, and this was done using 5ΒΌ” floppy disks in the early and mid-1980s before BBSes became popular – essentially the equivalent of bringing a USB stick to a friend to copy some stuff, except the disks could only hold 170 kilobytes each (yes, that’s kilo-bytes). You’d have first dozens, then hundreds of the disks, and I grew tired of not knowing which game was where, so I wrote a database that would scan a disk, ask you for which files were what, and catalog it. It was called Game Library in all simplicity, and I compressed it using a (pirated) BASIC compiler and shared with some of my friends who found it useful.

Later that year, a person I know who would go on to become one of the major investors in Spotify came up to me and asked “Rick, did you write this?”. I had no idea how he had gotten a copy of my Game Library, but felt happy and proud that people had shared my tool in paths unknown to me so he had received it.

By seventh grade, I had fallen in love with C on the IBM compatibles. I absolutely loved the concept that a pointer was an array was a pointer, and happily declared a far char pointer to be 0xB8000000, and named it “screen”, and went on to treat the entire video buffer as an array. (Remember “far” pointers on the 16-bit architectures?) I was having the time of my life playing with multiple video buffers that were swapped in and out on vertical retrace.

We were a bunch of guys in school who were playing around with the school’s computers when they weren’t being used, coding stuff like this for fun, and we were all at about the same skill set. My coding was far from an isolated phenomenon, as the “kids can’t code” would imply. Having fun while coding was a group activity.

By eighth grade, I was doing some more advanced memory stuff. To help me learn English and French in school, I had written some language aids that – just for kicks – held the translations sorted in both languages at the same time, using two sets of doubly-linked lists for the set of words I should learn to translate. One set was the origin language, the other set was the destination language, so from any word, you could step up or down in the alphabet of either language.

By ninth grade, I was projecting 3-D graphics and rotating coordinate systems. This was quite past the addiction of Elite but I still wanted to recreate that kind of graphics. On seeing one day how eight corner markers were moving on the screen in the pattern I had tried to achieve, I recall calling one of my friends in class and almost shouting in joy “Maria, the cube is rotating!!” She bugs me to this day about that being one of the most confusing phonecalls she had taken to date.

By tenth grade, I expanded that to four dimensions. Just for kicks, I wanted to visualize a hypercube, and came to understand its geometry by rotating it in the four, three, and two dimensions.

In doing 3-D graphics, I had also learned to not draw surfaces that were facing away from the viewer, by computing the surface normal and comparing it to the vector towards the viewer – the angle between them had to be less than 90 degrees for the surface to be drawn. In this way, I was able to render any convex polygon object, and played around a bit with that, as well as sorting the objects themselves by distance (drawing farthest first).

At this age (16), I started my own firm building custom software – as did quite a few others at my school with about the same skill sets. I would go on to have my first employee at 18, after graduating from secondary school but before my Army tour.

You don’t have to ace Mensa’s entrace exam, have an IQ of 169 or whatever or get some kind of award for being one of the world’s smartest people to be able to code as a kid: I did. I coded. I loved coding. Therefore, so could any other kid that wants to code and has an interest for doing so.

Today, we have coding tools that are several orders of magnitude better than what was available 33 years ago, when I started coding at age 7. Don’t tell me kids can’t learn to code. I did, and so did my friends.

I still love coding, by the way.

[UPDATE: On a fresh re-read, and as pointed out in the comments, the referred comment doesn’t really speak of what kids are capable of, but what a suitable presentation method for a general audience might be. Therefore, this article is rather a response to all the other times I’ve seen the claim that kids can’t write real code, for the Reddit comment doesn’t claim that.]

Rick Falkvinge

Rick is the founder of the first Pirate Party and a low-altitude motorcycle pilot. He lives on Alexanderplatz in Berlin, Germany, roasts his own coffee, and as of right now (2019-2020) is taking a little break.


  1. BN

    Man, I feel old seeing how you have to explain what a floppy disk is using a USB stick as reference.

  2. Rikard Elfgren

    I’m sorry but I think you may have misunderstood the comment completely, those kids couldn’t get the program to work at first but they were learning weren’t they. I’m guessing (entirely out of the blue) that your first contact with coding weren’t that much more brilliant? And some of these kids will be intrigued and go on to learn more about how code is structured in their own time.

    1. Rick Falkvinge

      The comment says quite clearly,

      Sorting, or even code, might be much for a presentation for that age [3rd-graders].

      and I fail to see how this can be misinterpreted: it says clearly that 3rd-graders aren’t old enough to understand coding or sorting, and that makes me angry.


      1. OP

        (I’m the original author)

        That quote is in reference to giving a presentation to a class of 3rd graders. It’s talking about what would make a good, compelling presentation, not what they’re capable of handling. I 100% agree that kids of all ages can do amazing things, particularly on computers. Every kid who sat through that went on later to write full programs.

        Most kids do not learn best by having someone present compiled data to them. Get them interested, and it’s impossible to stop them from learning. I do note that in all your stated accomplishments, none were handed to you top-down, as reference material.

        The main point of that post was not that kids can’t code. It was just one way I’d had success introducing kids to coding.

        1. Rick Falkvinge

          Ah, yes – on a fresh re-read in the morning, I see what you were saying, and you’re absolutely right. My article still stands, though, just not in response to you. πŸ™‚

          I was very intrigued and entertained by your story of the presentation method – the last sentence just triggered something in me that wasn’t really in the article; an anger at all the times I’ve heard people talk down to and about younger people about their capacity.

          Your comment had to bear the cross for a lot of inconsiderate people when I wrote this, I’m afraid. I’ve added an update to explain that the article is targeted at disdain for kids in general.

          Also, thanks for getting kids interested in coding.


  3. passstab

    the problem is that an equivalent modern third grader knows how to install an app on his mothers iphone
    nobody is forced to learn anything about there computers to make there computer do what they want it to

  4. mijj

    if anyone is going to have enthusiasm, energy, imagination and ability to write code, it’s kids.

    When we start caring too much and think about how it fits into a career, that’s when we fuck it up.

  5. gaqzi

    Gets me thinking of Susan Sto Helits take on learning, from Terry Pratchett’s Thief of Time;

    β€Ž’It’s just that I’ve left the class doing algebra, and they get restless when they’ve finished.’
    ‘Algebra?’ said Madam Frout. ‘But that’s far too difficult for seven-year-olds!’
    ‘Yes, but I didn’t tell them that and so far they haven’t found out,’ said Susan

    1. Anonymous

      I had algebra in 7th grade

  6. Gregor

    Isn’t that a selection sort?
    Same order of efficiency as bubble sort.

    I think it was my first sort too–it’s a natural map for how we sort things manually.

    1. next_ghost

      Nope, selection sort works like this:
      1) Walk through the array and find the biggest/smallest item without changing the array
      2) Swap the first item in the array with the item you have found in the previous step and update the starting index of array
      3) Repeat from step 1 until you run out of items

      When the inner loop walks through the array in one direction and swaps every reversed pair it encounters, it’s bubble sort. Selection sort doesn’t modify the array in its inner loop.

  7. Jonas


    I made the exact same thing you did with floppy indexing. A program that read all files on a floppy storing them in a “database” on my second floppy drive. I then sorted them and printed them on my very loud commodore printer. A very useful tool! =)

    I also learned basic and assembler relatively early, but a few years after you since I got my first computer in 4th grade or so. Those were the days… Never stopped working with computers since then.

    Best regards, Jonas

  8. Max Pont

    U can’t generalise like that. I would say that only the geekiest 20-30% kids of a given age cohort can learn to code on this level.

    1. Anonymous


  9. Anonymous

    A lot of bragging here:)

    I just might do the same, although I am nowhere near your level. It was maybe somewhere around fifth grade I started playing around with batch files. I found it very amusing to make “disappearing” files, that removed themselves when clicked. I also played around with an old (even for the time) IBM 486 with some QBASIC, but I soon got bored, because I couldn’t make executable files from the programs, only run them from the programming environment.

    I also love electronics. Modifying, building and repairing, often for the only purpose of fun, even spending half an hour repairing something worth less than 10kr (approx 1.20 €). I guess I’m somewhat of a hacker, in the word’s original meaning.

  10. tinoesroho

    I didn’t learn how to code, but I did learn HTML at a young age. I was six when I designed my first website – on paper. Wrote the code, then sketched how it should be displayed. It took me a lot longer to “get online”, but when I did, I did it with a vengance.

    These days I add new functionality – I’m a hacker, too – to software by means of writing mods. Mostly simple ones. My brother, on the other hand… he’s been busy playing with “Platinum Arts Sandbox” and re-writing the lua code. He’s added a couple of quests to the unfinished test game. 0.o

    I hope to teach a group of grade twos to code mods for Minetest soon. First I’ll teach them to play it, and then show them how to make it better.

  11. Raybarg

    Good article, and the point probably is not only about programming, but everything. I’ve learned that kids very young (mostly young enough to not have been exposed to school “stupidification system”) are very very intelligent. They could easily appear “stupid” to me because of my expectation of their frame of reference, which I’ve set to the level of an adult.

    It is very clear that age difference of, say, 30 years puts a challenge in how to communicate with one another. It appears to be very easy to choose the easy path and declare communication with the young as “useless” because “they dont understand anyway”. But that is wrong path to take.

    Funny thing about human brain is that most of the accumulated experiences are very well stored in our brain, even if we are unable to cognitively bring back the whole piece of memory and observe it later, our brains still use all the information we’ve acquired. With this saying, a child of age only 2 years are already capable of understanding alot of spoken language and this means whatever we say to them might become useful to them later. Later in their life when something more complex is represented to them, they just think “how it makes sense”, because already present information helping the understanding.

    Another point to look at thinking kids are “stupid” is when trying to talk to a foreigner who dont really understand what youre saying… can easily lead to same “easy path” conclusion that such person is just not quite smart. πŸ™‚

  12. Toni Mateos

    I also started at an early age because, like many others who wrote here, I had a natural interest on it. But I also liked maths as a kid and, clearly, that wasn’t shared by most of my classmates.

    I would like to make a point, and also a help request.

    many kids (don’t bother agreeing on what percentage, it’s MANY kids anyway) don’t have a natural interest or talent at programming. Most, however, seem to have a natural interest at using computers, for gaming, socializing, etc. For those who don’t have a natural interest, trying to start with Basic, C/C++, javascript, etc., can be a blocker, just like having a bad maths teacher is a blocker for those without natural interest in maths.

    do you guys know of simplified languages for children? I’m sure there must be some newer languages where you just write a simple loop and, say, a circle moves in the screen, or a character moves… I you have suggestions, great, I’ll soon start trying with my daughter :=) (I know, Logo falls in this class :=)

    1. Raybarg

      MIT made something astonishingly beautiful with which anyone can learn to do “programming” with just a little bit of logical thinking.


      That project is SO fascinating. I am professional programmer and when I tried Scratch it was like I could pull out my thoughts from my head and just put the blocks of code and I had immediate results in safe environment.

      1. Raybarg

        Here is TED talk from Scratch developer, about scratch;

  13. oV FuSIoNZz Vo

    Ohh so they cant code ? Funny how i have been coding my own Grand Theft Auto Mod menus for about a year now for Xbox 360. So where this came from i have no idea … I dont code html but i have learned C++

Comments are closed.