The Noble Art of Successful Programming The Noble Art of Successful Programming

Good programmers are rare, for they not only have to know something about mathematics and a little about technology: they need a great deal of imagination, and on top of all that, a talent for organization. For the most successful programs are not simply put together like a shopping list - they are composed, like chamber music. It is important for the programmer to be able to picture what kind of reception the machine will give his composition.

A computer may accept even the most difficult program without offering any objections at all. But there are also cases - and they are more frequent than the programmer likes - in which a program that seems to have been put together with everything to appeal to the computer´s tastes is rejected by it out of hand. It refuses to calculate, goes on strike, says in effect that the job cannot be done.

Sometimes there are programs that the computer eagerly sets to work on, only to deliver after a short time - with all the pride of someone who has capably solved a difficult problem - a completely nonsensical result.

Those are the moments when computers are at their most human. Deep depression prevails of course during the next few days among the mathematicians who have to instruct the misguided computer. A bad program is as disreputable among programmers as "The Adventures of Zone, the Masked Avenger" is among literary purists.

Sometimes, however, the program itself is quite guiltless; the machine is at fault. No one is happier than the programmer if this happens, if he can prove that his supposedly infallible machine has made a mistake. After all, he too is only human.

However, the programs we are now going to tackle together are not likely to tax the capacity of any computer. Let us begin with a quite simple program involving addition.

The task is to add up 50 numbers.

The numbers have already been fed into the computer. They are lying there, tidily stored, under the addresses 1001, 1002, 1003 and so on up to 1050. You know what the computer has to do with each number: it must put the first number into the accumulator, add the second number to it, then the third and so forth. The instructions needed to carry out that process are by now familiar to you; they were described in the preceding chapter. But the symbolic script which the programmers use to write down the instructions for the computer to work with is something new.

In this symbolic program language, the first instruction looks like this:

(1001) = > A

That means: The number from address 1001 will kindly proceed to the accumulator! The subsequent adding instructions line up as follows:

A + ( 1002)
A + ( 1003)
A + ( 1004)

and so on. You will probably now be able to guess what these symbols mean: "Add the contents of address 1002 to the contents of the accumulator! And when you've done that, add the contents of address 1003 to what you now have in the accumulator! The symbolic message continues in this way until the two last instructions in the problem are reached:

A + (1050)

Curiously enough, the "Stop!" signal is very important, for without it the computer would keep looking for new program instructions until Kingdom Come, and the calculation would never end. If it amuses you, you could write down the sequence of instructions in still more detail, in the symbolic language of the programmer and in the instruction language of an automatic calculator. In fact, we shall return to the language of the "ER 56" which you will remember from the last chapter.

Symbolic language

Computer language
(1001) A
A+ (1002)
A+ (1003)
A+ (1004)
A+ (1005)
. . . . .
A+ (1048)
A+ (1049)
A+ (1050)
10010 41 (Accumulator!)
1002 0 45 (Add!)
1002 0 45 (Add!)
1002 0 45 (Add!)
1002 0 45 (Add!)
. . . . .
1002 0 45 (Add!)
1002 0 45 (Add!)
1002 0 45 (Add!)
7900 0 00 (Stop!)

In computer language, the "Stop!" instruction carries the number 7900 in the address part. The "ER 56," however, has no address with such a number. This number is not decoded in the instruction unit into an address inquiry pulse; it gives immediately the short and snappy command: "Switch off! Counting's over"

Numbers in parentheses >>>>

© by PhiloPhax & Lauftext & Redaktion Lohberg
Kybernetik - Was ist das?

First printed in Germany: 1963


Cybernetic Computer and Electronic Brain

The fascinating story of how computers work in clear, non-mathematical language