Some programming terms
Introduction
Like all things, there are a number of terms, jargon, that you need to know when programming.
Variables
You can think of a variable as a box, the contents of which can change. The programmer sets up a variable at the beginning of a program, giving it a name (an 'identifier') and saying what data type it is (so the computer can reserve the right amount of RAM for the value that the variable will hold). In addition, the programmer may also decide to put a starting value inside the variable. This is known as 'initialisation' and means that the variable will have a known value in when the program starts, as opposed to an unknown value. Using variables with names rather than memory address makes programs easier to read. In addition, programs can be loaded anywhere in RAM by the operating system and even in different places in RAM on different occasions! All the operating system has to do is allocate available memory addresses to the variable names!
Constants
You can think of a constant as a box, the contents of which never change. The programmer sets up a constant at the beginning of a program, giving it a name (an 'identifier') and saying what data type it is (so the computer can reserve the right amount of RAM for the value that the constant will hold). The programmer will then set the value of the constant.
Constants are used in programs so that if the programmer needs to make a change, they only have to make the change in one place. For example, if the VAT rate is needed in many places in a program, the programmer refers to a constant called VAT_RATE. At the beginning of the program, this was declared by the programmer to be 0.175. Suppose the VAT rate changes to 15% in the Budget rather than the 17.5% it was before. All the programmer has to do is change the value where the contant was declared. They don't have to go through the whole program and change every instance where the VAT rate was used.
Identifiers
An identifier is the fancy programming word for a name of something that the programmer sets up, like a variable or a constant or an array, for example. The programmer can then refer to those items using their names (rather than the memory addresses). Each programming language has its own rules about what you can and can't use in a name and you should make sure you know what the rules are for the languages you are learning on your course.
Reserved words / keywords
Reserved words or keywords are words that the programmer cannot use as identifiers because they are used by the actual programming language. For example, FOR and IF and INTEGER are keywords in most languages and couldn't be used as a variable name. All programming languages have a list of reserved words.