Thursday, January 17, 2008

Writing a program for Intro to Computers

Many years ago, not quite back when dinosaurs roamed the Earth, "people" did not have computers. Not that there weren't people with computers, just not a lot of people. "People" were not expected to have a computer at home, many "people" worked in offices that did not have computers, and most "people" did not even know how to type.

Aside from the "people" who did not have computers and did not care about computers and never suspected that they would ever get a computer, there were the select few that did care about computers and had even been allowed to use a computer and even planned to someday buy a computer. Some of these select people had computers forced on them by their employers, but then later they decided that computers were good things. But most of these select people were people who just always liked computers. They were Trekkies and/or guys in the chess club. The wore glasses and/or pocket protectors. They had heard rumors of people called "girls", but most of them didn't have enough time to go find out if the rumors were true.

These people were nerds. More specifically, they were computer nerds. They would soon become a well-liked group of people. Soon they would be seen as gifted people with skills that many would need but few would possess, but not yet. At the time the only people who liked these nerds were their moms, other Trekkies and /or guys in the chess club.

My brother and I got to go to a computer store with my dad. The store was not full of regular sales people, but with these nerds. These nerds didn't try to sell you anything; they just liked to show off their expensive toys, mostly to fellow Trekkies and /or people who played chess. They were so totally unconcerned with the actual business of selling the computers that they would often let you stay in the store with them after hours and play chess and video games.

Unfortunately, my dad did not buy any of the expensive toys at this computer store. He played chess, watched Star Trek, wore a pocket protector, carried a calculator, and could even boast of having won awards in something called slide-rule competition. These were his people, and this was just the kind of thing that he could get into. But the particular computers in this store were out of his budget. What he was looking for was a bit more basic. Soon after this he ordered something called a VIC-20, and if I remember correctly it cost him about three hundred dollars.

So while I was not one of these computer nerds, I certainly knew people who were. I was around computers before most "people." I even learned how to type.

Almost ten years later, he bought something called a PC. Some sort of IBM clone. It had a word processor called WordPerfect. I was going to be a writer. And I was very happy.

Soon after I had learned to use as much of WordPerfect as I cared about learning, I found out that my plan to graduate from community college with an associate degree (the "transfer degree") was not going happen on schedule, because I was short two classes that were not required at the university I planned to transfer to. One of those classes was Speech 101, and the other was Intro to Computers. So I signed up for both of them, and still tried to keep my part time job and everything else in life pretty much the same as it was. I didn't think that two classes would take up that much time.

And mostly, that was correct. The reading assignments and tests and such for both classes were reasonable. Unfortunately, the speech class required me to talk in front of other people. About half of my grade was based on speeches a few other exercises that required me to stand in front of the whole class. I didn't like that. I didn't like that at all.

So school was going fine, and I was getting an A in both classes, but that was all about to change. I had the first of two major speeches coming up. The speeches were each worth twenty percent of my grade. And I figured that if I did not do well on the first one that the second one would be even worse. So I had to really do well on that first one, or I would screw up about forty percent of my grade.

In the computer class we were told that we would be writing this little program, but not to worry about it too much. It would be something really small and if we were paying attention in class we should not have a problem with it. Later, a bit before we were to do this assignment, the teacher told us about the program and what it was supposed to do. I tried to write down what he said. The program would be about football. It would figure out a players total yards and average yards and what was the most yards the player had in a game and how many touchdowns a player had, etc....

This is already a bad sign. I know nothing about football. I care nothing about football. I don't think that there is time to pretend that I care about football and learn anything useful about it. I'm worried that my lack of knowledge about the game will keep me from being able to write this program. The teacher tries to tell me that this is not the case, and that starting next week most of the class time for the next two weeks will be about how to write this little program, and then the assignment would be due the following Tuesday. But it should all make sense long before then.

After I went home and looked at my notes, I realized that the computer program was due on the same day as I was scheduled to give my first speech. I would have to do the computer assignment, and then five minutes later be prepared to give a speech. I did not want to do that. In fact, I had been planning to leave computer class early so that I might brush my hair and put on lipstick and all of that so I would look nice for my speech. In fact, I'd really thought that the best idea would be to skip computer class that day so that I would feel calm and relaxed before the speech class.

After looking over the notes and the syllabuses for both classes, I figured out that the little computer program was only worth four or five percent of my total grade in computer class. There was no way that skipping the entire section could cost me more than ten percent. Even a perfect grade worth four to ten percent of the total grade of computer class was not worth the risk of ruining the speech and the twenty to forty percent of the total grade in speech class. And I did not expect to get a perfect grade anyway.

I decided to skip the computer program assignment. And since that was all that he was going to talk about for the next two weeks, there was no point in my attending computer class during that time. I would still keep up with the reading assignments, but I would not write the little football program, and I would have extra time to devote to geting ready for my first speech.

I was able to do my work on the speech and get lots of practice in. And at some point the teacher of the speech class asked if anyone who was scheduled to speak on that Tuesday would like to go early and speak the Thursday before. And I was ready, and I got my speech over with Thursday, and then went to work as usual after school on Thursday and on Friday.

After work on Friday, I realized that I had a whole three days to figure out how to write a little computer program about football.

My dad knew a thing or two about computers and understood the general idea of how to write programs in Basic. My new husband also understood the general idea. And both men knew about football.

As for the programing in Basic, there were a lot of commands, some of which were math related. And "go to" was written a lot. And from the notes I had I knew that all the lines of code were to be numbered, but rather than number the lines 1,2,3,4, etc...they should be numbered 10, 20, 30, 40, etc.... That way, if you forgot a line that should have been written between the first and second lines, you could now just add line 15 instead of writing in a second line 2 and then renumbering all the lines after that.

I got about five lines done before I was seriously frustrated with the thing. Then either my husband or my dad came and made suggestions. I'm sure one of them did the major work when I encountered my first problem. I was able to do more of the work myself after that, but there were still problems.

After a while I started to get the hang of it. There was a lot of stuff to "go to" something that I had already written, or places to copy something I had already written and then make minor changes. Three days later, I had a program that did about eighty percent of what I thought it was supposed to do. I never did get the touchdown thing worked out. Touchdowns do not seem related to yards. My dad and my husband didn't have any helpful advice on that one. It seemed like that would have to be a totally different program, and I was out of time.

But I went into class happy. I think my program was two or three pages long, and I had it both on two disks and two hard copies. If you gave me the names of football players and their yards for a number of games, I could print out the all the players' names and statical information such as a player's total yards and the player's average yards and the number of games a player played in and the number of yards on the player's best game and everything that you could possibly want to know about how well the players did in the games, except for the number of touchdowns.

And then we went into the computer lab, and I thought that the teacher would hand out copies of the sports page or something like that with the relevant information. But instead there was something that was either already on the computer or on a disk. And we were told to print out a piece of paper with the information he asked for and we were given a time limit. And everyone printed out a page with the information on it, no problem. Everyone except me.

They didn't write a real program at all. They wrote a merge file. He'd already done the program. They wrote like ten lines or something, and I'd written a whole program. And my program didn't work with his program. The first thing that my program did was count the number of games. There was no place where the games could be counted, so my program printed out total nonsense based on the information from the other program.

I could not think of what to do, and I quickly gave up and left. I calmed down enough to go to speech class and hear the other students give their speeches. Not that I was in a calm enough state to really listen, but it would have been rude not to go to class after the rest of them had to sit through my speech, and maybe there were points off if you missed class when someone else was scheduled to speak.

Later, I realized the solution was to go back to his program and add a bunch of zeros to his information. That gave my program something to count, and it mostly printed out what it was supposed to after that. It was too late to get any credit for all of my work, but I turned it in anyway, just to show that I could do it.

I ended up getting an A in speech class and a B in computer class, because I got good scores on both of my speeches but a zero on that computer assignment that was worth five percent.

The students who took classes from this teacher after Intro to Computers all bought T-shirts saying which classes they survived. I have no such T-shirt. And I have no desire to ever get one.

2 comments:

dmarks said...

I wish I could remember my first computer program. I am guessing it was a simple sound program on the Atari 400... and I wrote it for fun, around 1979 or 1980 or so.

You are right about the "people did not have computers" thing. I've watched as over the years that changed. I remember when it was strictly hobbyists and professionals, and then later it got "Democratized", and now we have Mommy Blogs.

There used to be something called BBSs that everyone used with phone modems. That vanished with the modems, and was never replaced. Blogs are sort of like personal BBS's, but not quite the same.

DD said...

No computers? What did people do all day? How could they work?