MUMPS Programming/Things
Table of Contents Back to Introduction << >> Chapter 2
Chapter 1
As you can see, it gets a bit confusing when talking about things inside a computer, so we have to come up with words that describe what is going on in as simple a way as possible. We talked in the introduction about telling a computer what to do.
The problem is that usually, we don't want to be constantly telling a computer what to do. Now, this isn't always true. There are some games where we do want to tell the computer stuff to do all the time, but even then, we pretend that what is happening inside the computer is like something that happens in the real world. We pretend to be driving a car using the computer screen like a car window, or pretend we are fighting or looking for something. Some times we aren't pretending, and we still want to type a lot of things into a computer, but it isn't because we want to talk to the computer. We just want the computer to give the things we type into it to someone else. This is when we want the computer to act like a pipe, sending stuff we say to someone else on their cell phone or their own computer. Most of the time though, especially when we use a computer to do our work, we want to use the computer as a way to Record things, or retrieve things we previously Recorded.
So what kind of things are we expecting a computer to keep track of? Some things in a computer don't change very much, and other things in a computer are constantly changing. When computer people talk, they usually use the word Data to describe the things that don't change much, which are Recorded inside the computer. Since we don't really want to be constantly commanding a computer to do the things that change all the time, we create things that don't change inside the computer, which describe what we want done. Computer people use the word Programs to group together all the things that describe what we want the things that change all the time to do.
It's a lot easier to talk about things that don't change constantly, so for a while, computer people didn't actually name the things that change all the time. We knew they existed, but since they really were just patterns of charges and electricity, and flipping of very small electric switches, and small magnets changing polarity, it wasn't necessary to really call them anything. Eventually, computer people realized that if you don't name something you can't really talk about it easily. This realization happened in several different places about the same time, so there are several different names for these constantly changing things in the computer, depending on who was needing to talk about them. Sometimes these things are called Processes or Tasks or Jobs or Transactions or Events. Some people with a lot of imagination pretended that the insides of computers are full of living things so they called them Actors or Daemons or Agents.
Some of these things that are constantly changing will show a person sitting at the computer what they are doing, by changing something on the screen. An easy example of this would be a clock. Many times, a computer will show the current time and day in the corner of the screen. Since time is constantly changing, the letters and pictures of the clock have to constantly change too. The only way that the screen can change is if one of the computer's processes is making it change.
Depending on whether people can directly change them, a task might be called a foreground task or a background task. The idea is that if something is happening inside the computer that is not visible on the screen, or that a person can't control by using the keyboard or the mouse, then we talk about the task as if it is hiding in the background. If there is something happening that we can act on directly, it happens in the front of other things, and so we say it is in the foreground. And because you can act directly on a job that is directly responding to your requests, foreground jobs are sometimes called inter-ACT-ive or interactive jobs.
When you are working with MUMPS and VistA, you will find that we use some of these words to mean very specific things. For example, when the computer is doing something that only MUMPS tells it do, MUMPS people decided to call it a Job. When the computer is doing something that VistA told it to do, it is called a Task. There is even a part of VistA which lets a person manage all of these tasks, called TaskMan. (TaskMan is short for Task Manager) Usually Tasks happen in the background, but Jobs can happen both in the foreground and in the background. The word process is used more often by people who aren't specifically working with MUMPS and VistA.
Generally, it is easier to discuss things when you put them into different groups or categories. So let's talk about some of the simplest ways to group things. When you think about it, the simplest way to separate things is to put everything you are interested in into different piles, and then put a name on each of the piles. It is easy to group things when they are different things you can touch. But what do you do when you want to group things together that you can't touch? You can't really touch words or numbers or pictures, but these are the kinds of things that you normally put in a computer.
You may have heard that everything in a computer is made of ones and zeros. Even the Mona Lisa can be represented with ones and zeros. In all the wires and charges inside a computer, things naturally can be grouped based on how the wires and electricity or magnets work together. It's pretty obvious that if two wires cross each other, they either cross with the first on top of the second or with the first under the second. If you put a magnet where the two wires cross (and the magnet is polarized either north or south) or you put a capacitor there (basically an electric bucket that is either charged or not), you can see that each crossing will belong to one of only two ways to group things. This isn't exactly the way that things are stored in computers, but it gives you the general idea. The actual way is closer to having a very small switch in the place where the wires cross that is either turned off (open) or turned on (closed). It doesn't really matter if you call one group the black group, and the other group the white group, or label one group with the number zero, and the other group with the number one. The important thing is that you can use these two different groups to build up more complicated patterns. It is the more complicated patterns that are used in the computer to store numbers, words, pictures, and all the other things that people want to save in their computer.