Computer Software and Languages
Hardware is the muscle and bones of the computer; software is its gray matter. But mind still resides with us.
--------------------------------------------------------------------------------------
------------------------------------------------
Hardware makes up one aspect of the computer, the part that collects dust. It includes things like the central processor, display monitor, keyboard, printer.
Software is the part that makes the computer run: the directives -- the program of operations that tells the hardware what to do. It is the code that gives meaning to computer operations.
The remarkable thing about computers is that their basic operations can be used in many ways, just like the human body. They can be programmed to play many different roles. Bookkeeping, for instance. Or drawing pictures. Or writing books.
We play computer games. The computer assists in our education and training. We arrange huge amounts of data with it. We use it to design houses, machines, and automobiles. And we apply computers to control robots or run factories. We do all this on the computer with essentially the same basic machine structure but with different sets of applications programs, all created by human ingenuity. The function is much the same as we ourselves process stimuli to generate our personal virtual realities, or what we call our experience -- the real world, as it is said.
The art of computer use lies in imaginative programming. Skill is needed to sequence the operations in a way that generates useful and productive results. Encoding is involved. You have to assign meaning to the possible combinations of electrical switching and current flow and in this way interpret them. The operations have to be made to represent, or stand for, something. You have to construct a model for the representation.
The computer has no sense. What it has going for it is speed. It does very simple things in many different combinations, and it does them very quickly. But it doesn't think -- not yet, anyway! Every move it makes -- every step it takes -- has to be given as a directive or command. Computer commands are like orders you give to a horse when you tug on the reins. The directions originate with a model of action in the form of a sequence of instructions.
Even parallel programming requires directives. Sequential or parallel, no event occurs without reason. Events have to occur in sequence or be triggered by establishing sufficient conditions for their occurrence or by action taken by a user. Even so, the events have to be pre-defined and the coding to implement the events has to be available. This requires planning and design.
You and I use language to communicate with one another. We use the symbols of language to speak or write. In this way we send and receive information. Sometimes the communications are in the form of commands, like parents telling kids what to do. We transmit information to the computer and may receive information in return.
Encoding and decoding are involved in the interactions. The ideas or directives are expressed by means of the coding mechanisms of language. Different languages have different construction forms and techniques. French is different from Albanian, and Albanian is different from English. Also, sign language is different from spoken language. And computer language is different again. Each language has its special syntax -- conventions for meaning -- and its own keys to interpretation. Each uses its special code.
Just as English or Albanian words have to be encoded and decoded by us when we talk to each other, so, too, computer words have to be encoded and decoded when we "speak" to machines. The words have to "mean" something in terms of computer operations and they have to be assembled into meaningful groups, like sentences and paragraphs. We encode when we send messages, and we decode when we receive them. In either case, we have to "understand" the language. We need to know how to encode and decode. We need language skills.
-----------------------------------------------
Computers work well in binary, but they don't "understand" human languages. Conversely, humans understand the binary system, but don't work well in it. We prefer richer languages, those with more than two meaning states. So we've developed higher-level languages to deal with computers. That is, we've devised languages with elements that translate into basic computer terms.
In the early days of computers the translating capability hadn't been developed to a high level and we were forced to write code in a very primitive way, only one or two steps removed from the machine processes themselves. We had to specify in detail how switches were to behave. So instructions were written in clusters of zeros and ones. For example, for eight-bit machine words, the instructions were written as strings of eight binary digits.
Machine language programs were also very long and tedious to write, because the machine has to be told everything. It has to be given the precise address for each item of information to be used. The precise operating registers have to be identified. The type of data stored has to be spelled out. Each operation has to be named. And the storage location of the product of an operation must be given.
---------------------------------------------
To alleviate programming stress, we've used the computer, itself, to do the detailed work. These days we use higher-order languages to direct the machine. That is, we've automated the detailed coding process. Instead of having to give the state of the switches, we use programs to convert higher-level words into the basic machine code.
Letting the machine handle the details can be a great advantage in writing a program, especially if processing time and efficiency of operation aren't so important. But there are situations where you might prefer to write the detailed code yourself. In fact, many experienced programmers prefer to use languages that let them get closer to the machine code. Some languages, such as C, are actually multi-layered. Along with higher-level statements, they also provide coding terms just a step above machine language. They let you encode in so-called assembly language, the way we programmed before higher-level languages were written.
------------------------------------------------
Assembly languages evolved early in the development of digital computers and represent the first move beyond zeros and ones. In such language systems the instructions are usually written in clusters of three-letter words, such as ADD, or SUB, for addition and subtraction. Special instructions are also used to store data in memory, to retrieve data from memory, to load the accumulator in preparation for the operation, etc. Even here, though, the assembly language has to be converted to machine terms, except that the conversion from this level is more direct.
No language has yet been developed that lets you talk to a computer the same way you would talk to another person. Any conversation between you and the machine is still very literal. Even at the higher end of programming systems, words mean only very specific things. Use of a word is still very strict. All possible conditions for its use are laid out, and each use has a specific result. There is no flexibility in the codebook, no fuzziness, no sense of context.
The computer can't tell you that data is correct or not, unless you program a procedure. It responds in one and only one way to a specific piece of information, according to your dictates. If the data is in error in the slightest amount, the output will be in error, too. For this reason, the machines aren't easy to get along with, and working with them can be very frustrating.
------------------------------------------------
There are two ways to translate from the higher-level terminology to machine language. One way is to translate a single instruction at a time, as the computer comes to it. Languages that operate this way are called interpretive languages. BASIC is an example. The language on which Visual Basic is based, it's a fairly straight-forward system and easy to understand. The translation is made while your program is being executed. As the computer steps through the program, one instruction at a time, it uses the language translator (interpreter) to translate the instruction into machine code, which is then executed.
The other way is to do all the translating before any instructions are performed. This process is called compiling. A compiler translates the whole program all at once, before it begins to process data. The end product in either interpreting or compiling is machine code, but the compiler converts everything ahead of time, whereas the interpreter converts during the program execution.
Interpreters make debugging easier, because you can find errors immediately. But systems using them are slower, because each instruction is translated on the run, the way speeches are translated at the United nations, for example. The members find out immediately what is being said, but as you know, this tends to slow the process.
Compiled programs, on the other hand, are considerably faster. In a compiled program, all instructions are in machine code so there's no waiting between instructions. No time is wasted during the program's run time to convert high-level commands into machine code. Everything is in its final form and ready to go.
--------------------------------------------