Welcome to the first in a series of computer lessons designed specifically for the Anthracite Area Computer Club. These lessons will review and build on the computer classes that were held in the Mount Carmel Public Library from December 26, 1994 through January 2, 1995. While this document is freely available for non-profit use within the Anthracite Area Computer Club, it remains the intellectual property of its author. The author retains all copyrights as well. |
Computers are revolutionizing the way we do almost everything these days. They keep track of our money, control our automobiles, and create the fantastic special effects for the movies we watch. But what is a computer? In the early days of computers people used to think of them as fancy calculators that dealt only with numbers. In those days, computers were so expensive and difficult to use that they could only be justified for use in very important applications like national defense. As computers became less expensive, they began to find use in business, but again they were only used for numeric applications like calculating tables and processing payrolls. This early association with numbers tends to dominate most people's perception of what a computer is and does. I would like to break through that perception with the first of several definitions that we will use in this class.
People have invented many machines for many purposes. People have invented machines that print newspapers and machines that separate cotton from seed. People have invented machines that fly and machines that drive. They have invented machines for entertainment and machines for war. They have invented machines that wash clothes and even a machine that makes toast. But one of the most remarkable machines ever invented is the machine that follows instructions. This marvelously obedient machine is called a computer.
A computer is a machine that follows instructions. It is interesting that this definition doesn't say anything about the instructions themselves. It only says that the computer will follow them. The instructions might tell the computer to add a list of numbers, or to calculate a bomb trajectory. The instructions might tell the computer to display a weather map or to amortize a loan. The instructions might even tell the computer when to turn a toaster on and off! This wide range of ability makes the computer a chameleon. To the scientist a computer is a scientific instrument. To the businessman a computer is a financial tracking and planning tool. To many young people a computer is a strange cross between an encyclopedia and a Nintendo. A computer can do all of this because it is a machine that follows instructions. Its repertoire of skills is limited only by our imagination and our ability to describe the instructions needed to fulfill our imaginings. While this course may spark your imagination, its main goal will be to improve your ability to describe your imaginings in a language that a computer can understand. This brings us to our next definition.
The concept of human language is familiar and natural to all of us. A human language is how we communicate with each other. When we (in the United States) talk to each other we typically use the human language known as the English language. If we want to speak with a person from Germany we would use the German language. If we want to speak with someone from Spain, we would use the Spanish language. Of course, since English is so pervasive, we can often use our native tongue to speak to people from many different origins. This is a fortunate circumstance for us, and one that most of the world does not share. Europe, for example, is a patchwork of many different languages which can be the source of social and political problems. It's very difficult to cooperate and collaborate with someone who does not speak your language.
The term "Computer Language" was coined to describe a similar situation between people and computers. Just as human languages contain words and meanings that two people can understand, computer languages contain key words and definitions that people and computers can understand. Just as there are many different human languages (like German, Spanish, French, and English), there are also many different computer languages (like Assembly, FORTRAN, Pascal, COBOL, Ada, and BASIC). While there are many parallels between human languages and computer languages, there is one very important (and somewhat subtle) difference. You may have noticed that while human languages let people communicate with each other in both directions, our definition of computer languages says that "people give instructions to computers". This has a very different flavor to it. Instead of just communicating with each other (as in normal human language), the definition of a computer language implies a master and slave relationship. People give the instructions and the computer follows them. This is a consequence of our first definition: A computer is a machine that follows instructions. In other words, we invented computers to do what we tell them. It shouldn't be surprising that our computer languages (that we also invented) are designed for people to dictate instructions and for the computers to obey them.
Before leaving the analogy between human and computer languages, there are a few more points that should be made. First it is important to recognize that human languages can be designed for specific purposes. Pilots and air traffic controllers, for example, have developed a very specialized language that supports efficient and unambiguous communication of critical flight information. This language has a special syntax and set of key words that are difficult for non-pilots to understand. The same kind of language specialization shows up in the fields of medicine, law, and engineering. Computer languages are also designed for different specialties. The FORTRAN language was designed for scientific computing (the name FORTRAN is an acronym for FORmula TRANslator). The COBOL language was tailored for business computing (COBOL is an acronym for COmmon Business Oriented Language). The name "BASIC" stands for Beginners All-purpose Symbolic Instruction Code, and the BASIC language was originally designed at Dartmouth College in 1964 to help college students program the school's General Electric 225 computer. Since that time, the BASIC language has evolved to include many features of the other languages and has been widely accepted as the "common denominator" of computer languages. This brings up another parallel between human languages and computer languages. It turns out that some languages are more universal than others. English, for example is widely spoken by people of many different nationalities all around the world. The same can be said of the BASIC computer language. BASIC is probably understood by more computers than any other computer language. It is also interesting to note that the English language has borrowed many of its words from other languages. This is also true of BASIC which has incorporated many of the most useful features found in other computer languages.
As we have discussed, there are many different computer languages that have been developed for many different purposes, but they all have one thing in common. They were all designed so that people could give instructions to computers. Our next definition will unite our definition of Computer Language with our notion of Following Instructions to produce the Computer Program.
Just as human languages would be useless if we never had anything to say, computer languages would be useless if we didn't have something that we wanted the computer to do. At this point it is useful to compare a computer program to a book. A book is a list of sentences that communicate an idea or story. A computer program is a list of computer instructions that communicate a job for the computer to do. Just as a book can be written in (and translated to) many different human languages, a computer program can be written in (and translated to) many different computer languages. The analogy can be taken even further. While a book is a list of sentences, it is usually subdivided into chapters and paragraphs. The same is true of computer programs. While a computer program is a list of instructions, it is usually subdivided into modules and subroutines (we'll learn about these later). Finally, certain kinds of books are themselves instructional in nature. The wide variety of "How To" books are very similar to computer programs in that they are a list of human instructions that you can follow. For example, when you follow a list of instructions from a cookbook you are acting very much like a computer following one instruction at a time, step by step.
The following example should help to solidify our definition of a computer program. The example compares the instructions that might be found in a book on how to build a house with the computer instructions that draw a house on the screen. This very simple builders guide (on the left) has three sentences: (1) Lay the foundation. (2) Erect the walls. (3) Put on the roof. The corresponding computer program has five instructions. While the details of the computer instructions are not important for this discussion, it can be seen that each instruction draws a line, with one line for the foundation, two lines for the walls, and two lines for the roof. If you ask a builder to follow the instructions in the Builder's Guide book you might get the result shown below the three sentences. On the other hand, if you ask your computer to follow the instructions listed in the Computer Program you will get the result shown below it.
Builder's Guide (Book) | Computer Program |
Lay the Foundation. | LINE (100,300)-(300,300) |
Erect the Walls. | LINE (100,300)-(100,200) LINE (300,300)-(300,200) |
Put on the Roof. | LINE (100,200)-(200,150) LINE (300,200)-(200,150) |
![]() | ![]() |
This section has introduced the following definitions: