Information Technology Reference
In-Depth Information
2. Our programming language
English works with certain rules, and so do programming languages. It will not
matter which one you're talking about, as they are all similar. Since this work will not be
affiliated with any specific one, we'll deal with a hypothetical computer language, which
we'll call P language . It will have very specific rules, which we shall introduce from time
to time. Learning it should give you a good grasp of what any other computer language
involves. Since computer systems encompass a vast area of knowledge, we shall only
cover a small subset, namely programming.
Just as there are basic elements to English, P language has those same
constituents. Our language will use the letters of the alphabet a through z and other
special characters. We will not need capital letters but if ever someone uses one by
mistake or otherwise, that will not be a problem. Our system will simply assume it's the
same letter as lower case. The letters of the alphabet will be used together to form words,
just as in English. There will be three resulting uses of these words. The first will stand
for a variable - which shall always be represented by an underlined word. Once we get
into a program, you'll see the underline used. A variable will represent a value for a field.
We could use the field or variable
balance
to represent a bank balance for someone's checking account or the variable
interest-rate
could be the rate the bank pays on this checking account. Note that both these fields will
change in value and that's why they're called variables.
The next use for a word will be for something very significant in our computer
programs. These represent concepts - we'll get into them shortly - as well as verbs
dictating specific action to be taken. Referred to as keywords, each will be in bold print.
Thus
print
might be used to get a report printed on a piece of paper. Whenever it is used, it will
always accomplish the same thing, that is, produce output for a report. For that reason,
these words are defined to our system and cannot be used for ordinary variables. They are
keywords or reserved words. Usually a system has a list of all these words. Our system
will be no different and a list can be found at the back of the topic. We will define and
describe these verbs as we use them.
The third use will be for a label of a paragraph, which we'll get to later. We'll also
use operators - usually a single character - to do a few things, such as addition or
multiplication. To add the variable
deposit
to
balance
we could write
deposit plus balance
but instead we shall say
deposit + balance .
Search WWH ::




Custom Search