Mark Gilbert's Blog

Science and technology, served light and fluffy.

REM Moon Distances

I love computers and I love software development.

Of course, both have done their best to drive me insane at points, but as I look back on the 35 years of my life, I think they’ve brought me much more enjoyment than stress.

I am by no means a master developer – I have neither the breadth nor depth of knowledge to claim that – but at the very least I am comfortable sitting down at a computer to engineer a little miracle here and there.

But it wasn’t always that way.  In fact my initial experiences with computers were fairly rocky, at least when it came to programming.

My first exposure to computers came in the second grade when my elementary school was able to get ahold of an Apple IIe.  I don’t think they had an official “computers class”, but at the very least one of my teachers had enough experience with computers that he tried to teach the rest of us. 

Some of what I remember from that class was just playing video games.  To this day I still think this is a great way to get comfortable with a computer.  Playing a game, especially if it’s a virtual version of one that you like to play in real life (like solitaire, chess, or hearts), allows you to learn the basic commands and mouse maneuvers needed to get around the computer and software in general.

The rest of what I remember from that class involved programming in BASIC.  In particular, there were two lessons that I frequently recall.  The first involved a simple program that would print out my name multiple times without having to repeat the Print statement – obviously an introduction to looping.  The second was a simple program that would print my name multiple times, but diagonally as you went down the page:

Mark
   Mark
      Mark
         Mark

This second one did, in fact, use multiple print statements, and each time would print additional space before the name.

Later that week (I assume it was only a week or so later), my teacher gave me a quiz.  The first question was to write a program that would print my name multiple times without repeating the Print statement itself.  I distinctly remember being confused by that question, even though I had seen the completed program already, and as a result I botched the answer.

Now granted, I WAS only in second grade.  However, I was at or above grade level in everything else.  In fact, I got so far ahead of the rest of my class in math that I went on to be double-promoted, and spent the rest of my academic life a year younger than all of my peers.  I don’t say that to toot my own horn, but only to illustrate that there was something about computer programming that just hadn’t clicked for me yet, even when seemingly everything else did.

Some time after that quiz (probably within a year or so), I decided that I would write a program that would calculate the distance between the Earth and the Moon.  Don’t ask me why I thought this was something that I needed a computer program to do, but that was the task I gave myself.  My first (and I think only) attempt looked something like this:

REM Moon Distances
for i = 1 to 10000
for j = 1 to 20000
for k = 1 to 15000
for m = 1 to 35000
for n = 1 to 42000

By golly I going to master that loop syntax yet!  Loops for EVERYone!

Ahem.  Obviously, the concept of programming still hadn’t quite sunk in yet.

Somewhere around this time, my Dad sent away for a Timex Sinclair computer kit.  The computer arrived in pieces and you had to solder it together.  It did work for a time, but eventually we traded up for an Apple IIe – the same model that I had in elementary school.  That computer, with its green/yellow display, no hard drive, and dual 5 1/4” disk drives, lasted us into my high school years.  I remember my Dad doing some programming on that machine, copying programs out of computer magazines, one command at a time (it was only later that I figured out what peek and poke were for, but that chess program he typed in used a LOT of them).  I primarily used it for computer games (Ultima I and Wings of Fury were my two favorite) and writing papers for school.  The programming bug had left with Moon Distances, and hadn’t returned quite yet.

My sophomore year in high school, I decided to do a software-based science project.  I found a few books on fractals, non-Euclidean geometry and the like, and decided that I would write a program that would graph these out.  Never mind I was totally neglecting anything resembling “science” or the “scientific method” here – I just thought it would make a cool, stand-out-ish project.  With my Dad’s help, I wrote the program on the Apple.

I don’t know if the math involved was simply more than the IIe could handle, if I was just doing it wrong, or both, but the program took a frightful amount of time to run – it took several minutes to plot a single point, so before anything resembling a pattern required me to leave it on overnight.  Once I had a fair number of points plotted, I hit the equivalent of “Print-Screen”, and changed the formula being plotted to run it again.

Now, my high school happened to have a couple of Apple IIgs machines in the library.  I got permission to run my program there and was totally blown away.  Not only were the school monitors color – a stark contrast to the green/yellow display I had at home – but my program seemed to run 1-2 orders of magnitude faster.  What had been taking me overnight to complete on my home machine was getting done in half an hour there.  I decided to finish the “data gathering” portion of the project at school.

Looking back, that project was a milestone for me.  Regardless of the quality of the science project itself, I managed to get the computer to do what I wanted, and I’m pretty sure it didn’t require five levels of nested FOR loops.  The next year I decided to take the Fortran 77 class offered by my school, and it was that class where my passion for software really blossomed.  Finally!  Programming was coming as easy as math had in the ten previous grades.  Clearly, somewhere between “Moon Distances” and 10th grade my mind developed to the point where programming started to make sense.  So while I never any difficulty picking up math or science, programming required something more.  I think it was that year that I decided to major in Computer Science when I got to college

I did and I’ve never regretted it.

Advertisements

January 4, 2011 - Posted by | General

Sorry, the comment form is closed at this time.

%d bloggers like this: