Skip to main content
kld.dev

The first program I ever wrote

February 13, 2023

In 1991, when my sister was ten years old, she really wanted a computer. She pleaded and pleaded, and my mom eventually bought a used Commodore 64C from a coworker. At first, my sister and I had no idea how to use it, but thankfully, one of us noticed that LOAD "*",8,1 was written on several of the floppy disks. We typed it in, and finally, we could play the few games we had. I remember us playing Odell Lake, The Wizard and the Princess, and Winter Games.

The C64C also came with a copy of The Commodore 64 Programmer’s Reference Guide. I skimmed through it with grand visions of writing my own game. I was eight years old, so a lot of the math was over my head, but I remember learning about strings and floating-point numbers. I typed a lot of the examples into the computer, including this one from page 18:

10 PRINT "YOUR NAME:":INPUT N$
20 PRINT "HELLO," N$

After testing it out, I yelled for my sister and proudly asked her to enter RUN.

A few pages later were some examples using IF and THEN, which gave me an idea. I made some modifications and asked her to run it again. This was the program:

10 PRINT "YOUR NAME:":INPUT N$
20 PRINT "HELLO," N$
30 IF N$="JANELLE" THEN PRINT "THAT IS A STUPID NAME"

You can probably guess my sister’s name. That was the best code I will ever write.