Sunday, November 30, 2008

My First Computer


Like your first love, you never forget your first computer.


In the late 1970s, I worked for Beckman Instruments as a QC inspector in their hybrid microcircuits department. Hybrid microcircuits are very complicated things, so they had to be tested by computers connected to racks of testing equipment. The QC lab was filled with computers (mostly DEC PDP-11s) and innumerable shelves packed with electronic testing equipment – all of it the finest gear money could buy. It was an electronic technician's heaven.

I'll never forget walking into the lab on my first day of work. On the back wall there was this one equipment rack that stood out. It was sleek, modern, imposing. It had an angelic glow. I think I heard a choir when I first saw it. On a desk next to the rack was the computer that controlled it – a desktop device that looked like a large calculator. Eventually, I was allowed to use it - and that's when I fell in love.

It was a Hewlett-Packard 9825.

As a QC inspector, my job was to operate the HP 9825 - not program it. I didn't know anything about computer programming, but I wanted to learn. I wanted to learn because I wasn't satisfied with operating the 9825 - I wanted to explore it. I wanted to get intimate with it. So, on every 15 minute break and lunch break I would read the 9825 manuals. In time, I got a good understanding of the computer's language, but I didn't know how to write a program. I needed a printout of an existing program to use as an example, but there was no way for me to get one without asking one of the in-house programmers for it.

The programmers in our department were a group of about 4 guys. They were brilliant because they had to know more than computer programming - they also had to know electronics. It wasn't enough to know how to construct a for-next loop - you also had to know Ohm's law, fast Fourier transforms, frequencies, etc.

In that group of programmers were two personality types – the territorial ones and the not-so-territorial ones. I approached the not-so-territorial ones about my desire to program the 9825, and asked if I could see a program printout. They gave me several. I pored over the printouts and eventually wrote a few routines of my own that manipulated the computer's display. The day came when I demonstrated my routines to the programmers - they were impressed. I continued learning and exploring. As long as I wasn't messing around with their programs, the programmers were happy to answer questions and give advice. But then things changed...

I was working with the 9825 one evening after the programmers left work. A test that needed to be completed before the end of my shift wouldn't run – because the program was stuck in a loop. It would ask the operator a question, and no matter what was entered, it would keep asking the same question. I agonized over what to do. I knew I had the capability to fix the broken loop, but I also knew that doing so might destroy the friendly relationship I had with the programmers. I reasoned with myself, “It's a simple one-line fix – it doesn't alter anything important. Surely they will be okay with it.” I fixed the program, completed the test, and then left the programmers a note about what I did.

My solution didn't go over well. The territorial types used my actions as a reason to lock the source code so that no one except them could alter it. Most of the programmers became less supportive of my efforts to learn computer programming. Except for one – he gave me a personal computer so I could continue learning at home. He also came to my house to help me learn other programming languages. In time, I started doing side programming jobs, which later became a thriving full-time business.

I've worked in all kinds of environments, from PC to mainframe, from single user systems to complicated enterprise class client-server systems. Through it all I have never forgotten my first love – the HP 9825.

Refactoring


When I was first introduced to Algebra, it didn't go well. Even though mathematics had always been an easy subject for me - producing straight A grades - there was something about Algebra that just didn't click. Despite my best efforts to do well at it, I failed the subject and had to retake it the following year. Fortunately, the following year was different - it clicked, and I was back to making straight A grades again.

Learning Algebra was like exploring a whole new world in mathematics - I was fascinated by it. There was one aspect of Algebra that had me hooked - reducing equations. I had a natural talent for evaluating complex equations and reducing them down into their simplest form. I thoroughly enjoyed doing it, I was very good at it, and I couldn't get enough of it. It was like crack.

When I became a computer programmer, I found a new (and similar) natural talent - refactoring. I would look at long, complex computer code and I would reduce it to its simplest form. In procedural languages I would create function libraries, and in object oriented languages I would reorganize classes and class methods. All of it came naturally and without any formal training in the subject.

I always wondered if I was doing it correctly and if there were other methods I could learn, so I picked up Martin Fowler's book on refactoring. It was worth reading. I agree with him that bad code has a smell and that some refactorings come naturally. I now have names for the methods I've used in the past, and I also have new methods I never thought of. After reading the book, I looked over some of the code I refactored recently and I was pleased to learn I did it "right" - there was nothing suggested in the book that would make the code simpler or better organized. I'm not trying to boast, I'm just saying it feels good to know for sure.

...

Sometimes I find myself getting frustrated while working on a software project. When that happens, I put the project on the shelf for a while and do something fun to occupy my time until I'm ready to get back to it. What's the "fun" thing I end up doing most often? Refactoring smelly code. I can't help it. It's like crack.

Introduction

I'm an IT Manager/Computer Programmer for a company that builds homes. I've been programming computers since 1978. The programming languages I've used are: Basic, Visual Basic, xBase, COBOL, PASCAL, Assembly (both x86 and IBM System 3xx), C, C++, and Java. The platforms I have worked on include DOS, Windows, Unix, and IBM VM.

I owned and operated a computer retail/service/consulting business for over ten years.

For a time I was Technical Editor of Coast Compute Magazine, and a contributing writer for Programmer's Journal.

This blog was created to be a place where I can talk about one of my passions - computers and computer programming.