How I Learned to Code Part I

3 minute read

It’s Boulder Startup Week. With so many tech startups in town, there a lot of focus on code and coders. How do you become a developer? What developer career paths are there? Where do I find work? Etc. Etc.

Coincidentally, my mom, who is pruning, sent me a copy of a letter I wrote, more than 30 years ago now, when I was applying to colleges. It I describe how I first learned to program. I had forgotten this story, but I think it’s relevant and worth sharing. My dad was, and still is for that matter, a college professor. One day when I was 10, he tool me to school with him. I was quickly bored, so he got a friend in the Computer Center to put me in front of a terminal, these where the mainframe dark ages, and show me how to play Star Trek. Star Trek this was a turn based text game and the goal was to hunt down and destroy some Klingons ships. You had a handful command, move the Enterprise, fire phasers or photon torpedoes, transfer power to the shields, that sort of thing. You choose a command and then you got the result.

It looked like:

COMMAND 1
-=--=--=--=--=--=--=--=-
    *
                         STARDATE  2100
                *     *  CONDITION GREEN
            <*>          QUADRANT  5,2
    *                    SECTOR    5,4
                         ENERGY    2500
                         SHIELDS   500
                   *     PHOTON TORPEDOES 10
-=--=--=--=--=--=--=--=-

I now know this was a BASIC program. A bunch of years back, someone port it to C# and you can see more at: http://www.codeproject.com/Articles/28228/Star-Trek-Text-Game (I shameless stole the above “image” from that page.)

I had a fun afternoon.

Fast forward five years. For whatever reason, I’m at work with my dad again and get access to the mainframe. I’m ready to play Star Trek, but it’s gone! Sometime in the intervening five years all of the game were removed no doubt as part of someone “professionalism” kick.

Now my mom was a librarian, which probably explains how I ended up in the college library searching for answers. What I found was a book copy of the BASIC source. I think the book was from Byte Magazine, and probably was this article http://archive.org/stream/byte-magazine-1977-03/1977_03_BYTE_02-03_Inexpensive_Joystick_Interfaces#page/n107/mode/2up

I know it’s hard to believe, but there was a time when you “downloaded” software by typing in printed code from a magazine or book. It’s in the Wikipedia, it must be true.

You might think that simply typing in code wouldn’t teach you much, but it can.

First there were the typos. This was many years before I learned to type. And this was done in the dumbest of text editors. I made lots and lots of mistakes. That meant lots and lots of error messages along with the need to learn their meaning so I could find and fix them.

In addition, BASIC was not a monolithic standardized language. There were many variations, flavors, and dialects. DOS BASIC was not Apple BASIC which was not Commodore BASIC. The BASIC of the program listing was not the BASIC of whatever mainframe I was using. To get the program to work, I was forced to understand the differences and learn to translate operations in one variant to another.

This investigation of an existing code base has shaped how I learn ever since. Next time I’ll share the story how I learned C but, even today, I learn best when I dig into something, pull it apart, and put it back together again.

Different people learn in different ways and I think that’s double so for coders. Developing software a mix of science and art and suites a wide range of styles. Not to dis code schools, they are a good starting point for many people. However, they need to teach a lot of different people a lot of skills in a very short time. As a result the are somewhat cookie cutter in their approach. They teach you how to color, but can only hit at how to draw.

What worked for me might not work for you. On the other hand, how they do it down at the local code school might not work for you either. So, next time you’re stuck, find someone else’s code a pull it apart and you’ll be on your way.

Comments