That old, warm, fuzzy feeling
I’ve been thinking a lot about how I started programming. More important than when, or how, is that precise feeling I got when I was at the keyboard trying my first programs. When feelings are involved everything it’s hard to explain, but let me try. Caveat lector: High doses of nostalgia ahead.
It was 1985, and Sinclair Research Ltd. had just released the new, improved ZX Spectrum + with “real” keyboard and 64 kB of memory. It was false advertising at its best, because it still had 16 kB ROM and 48 kB RAM, just as its former brother in the line. But it was a great computer, that was for sure.
Months before, my sister had started taking Computer Science classes in High School. Those classes involved using a bunch of ZX Spectrum to program some BASIC. She came home with a few handwritten sheets listing the most common BASIC commands, and I was curious to know about all that. She also brought home a photocopy of the Spectrum manual, and when I had a browse at it I knew all was lost for me: I was going to be a computer programmer.
I wrote my first program on paper weeks before our own ZX Spectrum + arrived home. I was eager to test if it worked. And indeed it did.
10 REM Spy Number (circa 1985) 20 RANDOMIZE 30 LET n = INT (RND*100)+1 40 PRINT "I'm thinking of a number between 1 and 100." 50 INPUT "Guess the number: ";g 60 IF n=g THEN PRINT "CORRECT! The number was ";n: STOP 70 IF n<g THEN PRINT g;" is too big.": GO TO 50 80 PRINT g;" is too small.": GO TO 50
It was all about that feeling of trying some code from the manual and seeing the results on the TV screen. Trying some
FOR loop to draw circles that somewhat resembled a tunnel, experimenting with
OVER 1 in such drawings (essentially each line was xor’d with the contents of the screen) to get some pretty Moiré patterns, the screeching sound that machine did when loading from tape, learning about trigonometry to be able to code a graphic clock. It all was magic. And it was under my command.
Those years I reinvented many things I didn’t know about yet, in a discovery proccess pushed by limitations. If I needed to make a linked list, I created two parallel arrays: one for data, one for pointers. I felt that it was a hack, but also that it was the best possible solution in a machine like that. I created my own twenty questions game, and decided it had to be able to learn, so I created a dynamic tree structure for it out of static arrays. I wrote my own assembler. I decided not to perform multiple passes, so I recorded the use of every unknown label to be able to patch at the proper address once that label value was known. Such things I discovered years later as standard solutions for standard problems, but then I was just a twelve years old boy playing with a mesmerizing toy. And yes: I’m bragging right now in behalf of that boy.
A few years later I was in the same High School my sister had her first programming classes, using the same Spectrum computers connected to the same B/W television sets. We did some BASIC first. Then we started using Logo. While everyone else was trying to make the turtle draw houses, castles, stick figures, I was sincerely intrigued about all that new concepts my beloved BASIC had been hidding from me: lists, list of lists, lists of lists of lists, procedures and functions, recursion, pass by value, pass by reference. It was around then when I understood there were other languages. I even tried Prolog for a while, creating a program which talked to you based on Markov chains created from the past inputs, even if I hadn’t heard about any Markov yet.
After more than twenty five years of programming I positively know that’s the old, warm, fuzzy feeling I’ve been trying to get back for years: the experiencing of the magic inside these machines. I have the intuition that they are just like Steve Jobs once said: bycicles for our minds, allowing us to think deeper about problems and how to solve them.
Maybe the trend in the last years of having all sorts of APIs and libraries (a good trend for sure in practical terms) killed part of the fun. One does not have to start from scratch. And that’s good if you want the job done as soon as possible. But you miss the learning proccess of thinking about the problem, thinking about the tools at hand, and building a solution all by yourself.
We programmers learn and build today mostly by googling and gluing together parts from the vast offer of pre-made code, instead of creating our own from scratch. “Don’t reinvent the wheel” they say, but maybe you just have to do it, at least once, in order to learn what your tools are and how the wheel really works.■