Home | C++ Tutorial |     Share This Page
The skill that makes your computer think

Introduction to Programming

Without a program, a computer has no purpose. It becomes an inert mass, a way to keep a door open when the wind blows.

What do I mean? Consider a paperclip. It has mass, material properties, and a tiny bit of purpose expressed through its shape. In truth, it exists only because of its shape. If it were a small disc of steel, the same mass as the paperclip, its purpose would evaporate.

The paperclip's purpose cannot be scaled up. If you put 1000 paperclips in a box, the mass increases but the modest purpose stays the same, innate to the individual paperclips. The intellectual content does not increase.

Jacquard Loom
Jacquard Loom
The Industrial Revolution saw the creation of increasingly ingenious machines, devices whose purpose was inseparable from their shape, and most of which could do just one thing. The most advanced machines had a single shape but could be instructed to do different things. For example, through the use of punched cards, the Jacquard Loom (1801) could create any desired textile pattern.

Then something interesting happened. The man on the street believed the ingenious loom was the source of value, the focus of attention, and there was some small truth to this. But hand weavers, employed more because of their aesthetic skills than their technical ability to pass a needle through cloth, realized the cards possessed a value separate from the machine. They contained the pattern for the cloth, and they would create that pattern on any Jacquard loom.

The Jacquard punched cards possessed instructions that governed the loom's actions. They were the first examples of what we would call a program.

By 1890, cards similar to Jacquard's were used to contain the data for the United States census. Each card contained all or part of a record describing an individual. They were the first examples of what we would call a dataset.

John Von Neumann
In 1952, a very clever man named John Von Neumann was working on a rather primitive computer that was programmed by moving wires about on a large plug-board. It occurred to him that the program could be stored within the machine, along with the data, in what we now call “random-access memory.” This removed the final obstacle to large, complex programs, the ability to switch tasks quickly, and the logical certainly that a program above a certain complexity level cannot be proven to be bug-free.

In a jewelry store, the value resides in the minerals displayed in the glass cases. If you want to determine the value of a gemstone, you examine its color and clarity and then you weigh it. Heavier stones are more valuable.

Computer programs also have value, but their value is much more difficult to assess. For one thing, you cannot weigh a computer program. In fact, a computer program has no physical existence at all. When the program is listed on paper, it takes a form that a programmer can comprehend, only because (s)he can imagine the actions the computer will take when confronted by the instructions. But the paper form is not the program, any more than a map is a territory.

When the program is stored on disk, the disk is most certainly not the program. Tiny magnetic domains (smaller with each passing year) represent binary zeros and ones that represent instructions. It can fairly be argued that a computer program is a product of pure intellect, has no physical existence, and therefore cannot meaningfully be secured against theft.

If you embarked on a project meant to grant programs a greater physical reality than they appear to have, you could create a machine whose individual parts represented instructions (like Charles Babbage's Difference Engine), but this conception would fail for two reasons. One, the parts would still stand in for abstract intellectual notions, and two, you would not be able to fix the inevitable bugs in the original intellectual conception that led to the program.

Babbage's Difference Engine
The good news about modern, Von Neumann-style program storage, is that you can change the program in a matter of seconds. This is also the bad news.

To summarize, a computer is a machine whose sole purpose is to faithfully carry out a computer program's instructions. It is no more than an input/output device to support the intellectual goals of a computer program (and a programmer). The computer's higher purpose resides in its program. This is why, as time passes, computers become less expensive and programs become more expensive.

It is why the richest man in the world is, not a builder of computers, but a builder of programs. It is why, over time, computer scientists have come to focus more on programming issues and less on hardware issues. It is why, when a government agency decides to upgrade its computers, it is almost always the case that, after billions have been spent, they discover the old software will not run on the new hardware, and they abandon the project.

As the Y2K issue shows, we began by thinking of computer programs as a nice part of our future, and now recognize them as crucial to our future. How they are written, using what quality standards and programming concepts, is now quite literally a matter of life and death.

Programming as addiction

I can't close this introduction without mentioning in passing that programming has a compelling quality that lies behind its reputation for turning otherwise normal, well-adjusted people into hollow-eyed nerds.

Programming is about as far from everyday reality as one can get and remain an inhabitant of Earth. If, while programming, you make a syntax error, the compiler may utter an incomprehensible error message having nothing whatever to do with the actual error. Or it may print hundreds of cryptic error messages in reaction to the inadvertent omission of a semicolon.

Assuming you aren't completely discouraged by your first exposure to programming, over time you may become more skilled at avoiding the more serious kinds of errors, and you also may become more adept at interpreting those error messages you once found so incomprehensible. Meanwhile, if you are typical, your physical health, along with your propects for normal human relations, may wither away unnoticed.

Eventually you may reach a kind of programmer's nirvana: the compiler will reward your sublime skill by compiling your 100,000-line program silently, without uttering a word. If the program also does something remotely useful, well, I am sure I cannot describe the resulting emotional state.

You can see the degree to which programming is alien to normal reality by noticing that, once you have written a program and it works, it will continue to work forever . It will never decay. It will never say, "What have you done for me lately?" or "Pay me more or you sleep with the fishes!" or "I can't believe I once thought sending files to a printer was cool!"

This is why programmers are not generally well-paid. For many, it is too much of an addiction for such trivialities as compensation to remain on the programmer's personal radar screen. Only a handful become financially successful, and those individuals usually direct the behavior of other (usually poorly paid) programmers, rather than taking the risk of sitting at a terminal themselves.

This viewpoint, based on my many years of programming experince, leads me to make this suggestion to all young programmers -- learn business skills as well as programming. Don't become one of those programmers whose work is never noticed or rewarded.

In closing

This section of www.arachnoid.com is meant to introduce the topic of programming, but not provide a comprehensive education in the field — that takes years of effort and great dedication. By reading these pages, you will acquire a sense of what programming is about, an overview of the territory.


These pages are Copyright © 2000, P. Lutus. All rights reserved.

www.arachnoid.com Main Page
Home | C++ Tutorial |     Share This Page