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.]