Introduction to Terminology
As a beginner, the sight of an already completed computer program seems impossibly complex. It is quite easy to be overwhelmed by the whole program. A program is however, made out of parts. You can learn how each part works one at a time and you can learn how the parts work together.
To communicate the ideas involved with programs it helps to have words that clearly express particular meanings. Two programmers having a conversation need to have the words to say what they mean. Those words need to have quite precise meanings. If there was a Tiger behind the door, you should probably say to your friend "There is a Tiger behind the door". Saying "There is a cat behind the door" is just as correct, but leaves out details that your friend may find important.
Words matter, In life and in programming.
Contents
Words to know[edit]
Most of these words already have meanings in English, often their meaning is similar in the context of programming. Sometimes words used in programming seem to have very little to do with how they are used in English. The bigger difference can be an advantage at times to stop you from mixing up the common English use of the word with the Programming use of the word.
This program is quite small. You may not understand the details yet but that's ok. It's here to show us what the parts are called. That will aid us in understanding how it works. You don't have to understand completely in one go. This page is not for a complete explanation of the concepts, it simply shows which word is used for a particular concept. Refer back to this page when you encounter one of these terms.
Convention[edit]
This is actually one of the standard dictionary meanings of the word. It is an agreed way of doing things. Often there is more than one way to do something but it would be better if everyone did it the same way. In these cases a convention can form in order to help people to work together. Because it requires agreement and there are always people who disagree, people argue about conventions a lot.
Illegal[edit]
Sometimes you can find a program will complain about something Illegal. Don't worry, this does not mean you have broken the law. It means some part of the program has broken some internal rule.
Identifier[edit]
An identifier is a name, it's job is to identify things. In JavaScript there is a naming convention for function and variables. It is suggested that they start with a lower case letter and the first letter of any other words in the name are capitalised, for instance soQuakeWithFearYouTinyfools starts with a small s. This is known as "lower camel case".
Function[edit]
The name Function is descended from its use in mathematics. The mathematical form purely provides a result from a given input. A math function that doubles a number can be written as
f(x)=2x
Which is a very compact way of saying "There is a function called f which is given x as an input and results in the same thing as two times x" A similar notation for the function starIt in our program would be
starIt(q)="***"+q+"***"
Functions in computer programs include an extra aspect. A function in a program can perform an action in addition to returning a result. starIt is a function that returns a result, but print is also a function and that returns no result. print is used for performing an action, printing text on the screen. A function may perform an action, return a result or both.
Call[edit]
Calling is when a running program temporarily jumps to another position within the program. Most commonly calls are to functions. the program above contains two function calls, on line 8 there is a call to starIt on line 2, and line 10 has a call to the function print (which is a function provided by the system so does not have a line number in our program).
Return[edit]
A return is the reverse of a call. When a call is completed the program returns to the place that initiated the call. A function will return if the program reaches the end of the function. Functions can also be told explicitly to return. When a function is told to return it can return with a value that can be considered the result of the function.
in the program above, line 3 returns to line 8 bringing with it the value "***Cheese is quite nice***" ...
Parameter[edit]
Also known as arguments, Parameters are the values given to a function when it is called. ...
Variable[edit]
A variable holds information. You can change the contents of a variable by placing new information into it. Over the course of a program a single variable may be changed to hold many different values.
This program creates two variables,
- snoo on line 6
- floo on line 8.
Value[edit]
Values are data of some form. Numbers, letters, words and sentences are all values. Values can come in even more complex forms. Values don't change, they get put into variables changing a variable means replacing the value in the variable with another value.
Values can be made. Adding 5 to 3 makes the value 8. Of course you cannot highlight all of the values that are made during the running of a program because they don't all appear in the code. Only a few starting values are listed in the program. Values that do appear written in the code are known as literal values.
Operator[edit]
Most people are familiar with some operators. Plus + and minus - are operators. Most languages use * and / for multiply and divide. in JavaScript = is called an assignment operator.
a = 3 means "put the value 3 into a".
JavaScript also has an == operator which is used for comparing.
a == 3 means "is a equal to the value 3"
You can read more about operators in JavaScript at http://en.wikibooks.org/wiki/JavaScript/Operators
Expression[edit]
An expression is a calculation that results in a value. These are all expressions
| expression | value resulting from the expression if x were 3 |
|---|---|
| 3 | 3 |
| 3+3 | 6 |
| 3+x+3*4 | 18 |
| 2*(3+4)-((3/x)+17) | -22 |
| "ook" | "ook" |
| starIt("ook") | "***ook***" |
| "ook"+starIt("ook") | "ook***ook***" |
| x == 3 | true |
All of these results are values.
Words to learn soon[edit]
Object, Method, Array, String, Loop, Literal
Words to learn later[edit]
Closure, Floating Point, Constructor, Class, Pointer, Reference, Instance, Event, Thread, Process, Stack, Interface
And many many more. Whenever people talk about a topic, words will come to be used to fill meanings as they are required.







