MUMPS Programming/Intro
Welcome to my web-pages on MUMPS Programming.
Niklaus Wirth, in a book named Algorithms + Data Structures = Programs, felt that equation described one of the fundamental topics of computer programming. His book was published by Prentice-Hall in 1976 and is arguably one of the most influential computer science books of the time.
But if you are just starting to understand computers and programming, this is the same as saying Blargh + Foobar = Quux. It's not as simple as just explaining what each of the words mean, either. Learning to program needs a person to develop a fundamental mindset that relates things they are comfortable with, to things inside the mysterious world of computers.
I'm hoping I can avoid using too much " Computer Speak", especially the jargon that people who really understand the subject use all the time. To help, I have created a page for a Glossary for the words I am using.
One of the essential issues to making both the computer words and ideas make sense, is deciding how to describe them. I will be trying to explain a particular way to think about things that depends on very common experiences and relate the computer experiences to those.
For example, one way to talk about a computer is as a container of things, where each of the things is connected to other things in the computer. This allows us to talk about things happening "inside" the computer and "outside" the computer. The truth is that computers are gadgets with lots of wires and computer chips made out of silicon and metal. They don't really have an inside in the same way that a basket or a hat might have.
But since computers can show the different power levels and charges on the wires inside of them using screens and printers, we can imagine the screens as a window into a place that doesn't really exist. We can't actually touch what is going on inside the computer, and if we did, we'd likely get a nasty shock.
We can pretend that we are seeing something really happening through the computer screen, just as when we look out the window of a room, we usually have a glass pane between us and everything happening outside the window.
The things happening "inside" the computer can't be touched any more than the things which we see through a window in our room. But we can still say and do things in the room that sometimes affect what is happening on the other side of the window. A computer is designed so that we have ways to say and do things so that what the computer does will change based on what we do and say.
It would be very easy if we said things in English, and a computer would react to what we say and things would change. Unfortunately, computers aren't living things, and so they don't have ears and understanding. Some very clever people are trying to understand speech and sounds, so that they can make a computer do what we say and mean, but it isn't easy, and people have been working on the problems for over fifty years. In the mean time, we have keyboards, and a mouse so that people can give information to a computer. It's really not a very good solution, but it is the only one we have that consistently works.
In the same way, the words we use when we talk to people have more than one way they can be understood. We can talk about searching through the fog of our minds to figure something out, knowing that there is no actual fog anywhere around us, and knowing the person we are talking to knows that there is no actual fog around us. We can use language that isn't precise or exact, but we know the person we are talking with can figure out what we mean. In fact, we say exactly what we mean so rarely, if we hear someone talking in a very detailed way, we assume they are talking to a small child or someone who is learning something, or maybe an animal. When we are telling a computer what we want it to do, we actually have to speak even more precisely than we do to a child or a dog.
One way we have to speak precisely to a computer is to change the language we use. Every word that is in a computer language has only one way that it can be understood. Each word also only has one form that can be used. In MUMPS, there are only commands and details for the commands. Sometimes computer programmers call this kind of a language an "imperative" language. This way of describing a language comes from an old French word that means "order", like putting things in a particular sequence, or commanding that things are done in a very precise way. Incidentally, this old French word also is a source for the word "emperor", the man who tells everyone in an empire what to do.
So the idea is that a computer programmer is like an emperor, bossing around the computer, so that what happens is exactly what the programmer wants, and only what the programmer wants. If a computer were a person, this would be rather rude, or uncaring, but remember computers are just gadgets. They are very clever gadgets, but they have no emotions or life to them at all. Just like a wind-up clock just moves the hands of its face as the spring inside unwinds, in the same way, a computer just goes through each of its commands until it runs out of commands, or power. In fact, the computer is always doing something, if it is turned on. Even when a computer is idling, it is actively idling, waiting to do something, just as a car when idling still is burning gasoline. The commands might just be "WAIT" and "GET A COMMAND" (which turns out to be "WAIT") over and over, but it must do some commands constantly.
This lesson on MUMPS programming is going to cover all the commands a computer that understands MUMPS uses, and the details which those commands need.