The year was 2002 and I had started gymnasium (≈high school). My parents had bought me the graphic calculator required for our maths classes: Casio fx-9750G PLUS. It was white and green and curvy and Casio — not dark and rectangular and from Texas Instruments, as a calculator was expected to be. Soon, however, this happy-looking thing became my companion on my journey into the world of programming.
Compared with a personal computer, this calculator was weak, to say the least. The display resolution was 128×64 pixels in black and white. (However, I did for a long time dream of the color LCD version CFX-9850GC PLUS, which could show three colors: orange, green, and blue.) The processor was slow. Graphing y = x2 took a good five seconds. Sinusoidal regression on 150 data points took 75 seconds, plus another 8 seconds to draw the sine curve. Memory was limited as well: 32K, of which only 28568 bytes were available to the user. And of which every list and matrix entry took up 10 bytes! Plus, any time something was graphed, 4K was reserved for that.
Yet for all these complaints, this machine was a fantastic place to start programming. Having a fixed set of features challenges you to do what you can with what you have. On this fixed platform, there was no getting lost in debates about which programming language to use, because there was only one choice. There was no trouble with installation or incompatible software libraries. There was no web browsing or multitasking. No distraction. And zero boot time and a year of battery life.
The basic calculator part is a REPL: That is to say it reads your input, evaluates it, prints the result, and it loops, doing this indefinitely. In this interactive environment, you can familiarize yourself with expressions before slowly, step by step, automating small parts of your calculations. You could, for example, make a small program that asks the user for input and uses a loop to do a calculation.
And there were enough features to do really cool things: Plotting, lists and list operations (sorting, summation, product, mean, median, etc.), matrices and matrix operations, statistics, regression, etc.
Programming on the Bus
During the bus trips to school I spent as much time with my Casio as people today spend with their smartphones. And I suppose this puzzled the other students: How much time can you really spend calculating?
I made programs for all sorts of tasks. One type was the programs that helped my maths and science classes. In maths it was nice to be able to enter the information you had about a triangle, and then calculate the rest automatically. Or calculate the greatest common divisor. In physics, I calculated and visualized refraction. In chemistry, I calculated molar masses.
But it was also fun and games: I made programs that drew nice geometric shapes for their beauty. I calculated poker odds. During some boring classes I made a program in which you entered the time of day (the calculator didn’t have a clock), and it drew a 3d pie chart showing how close the current lecture was to completion. And I factored out the pie chart so other programs could use it as a subroutine.
I made programs for sound and music. I translated between notes (such as A) and frequencies (such as 440 Hz). I visualized harmonics. I made a program that showed all the ways a chosen note could be played on a guitar. (And I didn’t even play the guitar!)
And I made games. Guess which number I’m thinking of, where the program tells you whether your guess was too high or too low. I made a game in which you had to remember random numbers that were shown in progressively shorter glimpses. Each level made the number one digit longer. I made Snake. It grew linearly slower with the length of the snake, and the game was too slow to be fun to play. But that didn’t affect my pride in making it. Near the end of gymnasium, I was planning a strategy game inspired by Command & Conquer Tiberian Sun, which I loved. I had a cool animation for the cyborgs’ machine guns, but other than that, I never got very far. But to be fair, it is a rather big step from Snake to that.
Much Learnage
This primitive programming taught me some lessons about “real” programming:
- Understanding a program you wrote months ago is tricky, when all variable names are a single character. I learned the value of descriptive variable names.
- The slow processor gave me a tangible sense of execution time and complexity.
- With an editor window of 6x21 chars, I soon learned that sketching your algorithm or architecture before implementing is useful for big programs. That would probably take more time to learn on a big screen.
- I learned to prioritize what to do with the limited memory.
- I learned debugging the hard way: There were almost no meaningful error messages (but at least you could be taken to the location in the code that caused the error).
- I learned that all programs and subroutines sharing a global address space sucks!
Interacting with the World
After some time, interacting with a program through a (tiny) screen and (tiny) keyboard was not enough. I wanted to interact with the world. Thankfully, my parents got me the Casio EA-200 data logger. This device was even clunkier than the calculator, but it was a window to the physical world: Now I could measure voltage, light, temperature, and sound.
I measured the fluctuation of the temperature in the fridge. Since I could hear the compressor swiching on and off I knew the temperature couldn’t be constant, so I wanted to know the extent of the lie that “a fridge is 5°C”. (As I recall, it went between 4 and 8°C). Knowledge is power, even in the small.
With the microphone and speaker, I made a dictaphone. As with Snake, the idea of making it was more important than its usefulness. It did work, but the memory was somewhat limited.
I also measured the fluctuation of the intensity of light from lightbulbs. Even when they appear constantly on, they heat and cool with the alternating current of the electric grid. And I learned about another “truth”: Our electric grid runs at 50 Hz. Yes, when it’s not 49 and 52 and 50.2 Hz. This is also where I got to appreciate the Fourier transform that I recently implemented myself.
My dear Casio, thanks for the ride.