As I learn more about programming, data analysis and other complex topics, I intend to keep track of all the terms I discover and write down their definitions. I will try my best to include plain-English descriptions and real-world examples. As I’m still learning, I can’t guarantee these terms are defined correctly so please do use your best judgement.
A special kind of variable, used to pass pieces of data from one piece of code (a program, subroutine or function) to another.
When an argument is used as part of that function, it is instead called a parameter.
For example, you have a piece of code that makes toast, it might have parameters that take people’s choice of colour, their desire for butter and their wish for jam. The choices available for such parameters are called called arguments.
A type of operator which uses numbers to perform simple mathematic equations. It is made up of two operands .
For example, if you were to say x + y the letters x and y are your operands. When you then ask the computer to show you the value of this expression you would get sum of those two values.
Although they vary in how they are written between languages, the arithmetic operators are roughly as follows:
Operator
Example
Description
+
2 + 3 returns 5
the right value added to the left value
–
2 – 3 returns -1
the right value subtracted from the left value
*
2 * 3 returns 6
the right value multiplied by the left value
/
2 / 3 returns 0.6666666666
the right value divided by the left value
%
2 % 3 returns 2
the remainder of the right value divided by the left value
A type of variable that can store multiple pieces of information and sort these pieces in a specified manner.
Arrays store values, sometimes alongside a key that identifies that value. Stroed values can be retrieved at another point, or be modified.
An array lets you add new items, delete items and rearrange the items inside it.
Think of a basic array – or indexed array – being like the following table:
Index
Value
0
Jane Doe
1
John Doe
Each row is a value stored within the array, the more items you add, the longer the array gets. Each value is assigned a number to identify it, starting at 0 and increasing by 1 for each new value. This number is known as an index.
In pseudo code you may write:
people = array("Jane Doe","John Doe");
print "My name is " . people[1];
Which would return “My name is John Doe”.
More complicated arrays, known as associative arrays, can use a specific name as a key for the values contained within it. Not all languages support this type of array e.g. Javascript.
To extend the example above, think of an associative array as the following table:
Index
Key
Value
0
Jane Doe
32
1
John Doe
46
Each row is a value and key pair. This pair is still assigned an index, but you can retrieve a specific value by using the key. So, if we wanted Jane’s age (the value) we would ask the array for the value of key ‘Jane Doe’.
In pseudo code you may write:
age = array("Jane Doe"=>"32","John Doe"=>"46");
print "Jane Doe is age " . age["Jane Doe"];
Which would return “Jane Doe is age 32”.
Even more complicated than that are multidimensional arrays, which are arrays nested within other arrays. Not all languages support this type of array e.g. Javascript.
Index
Value
0
Index
Value
0
Jane Doe
1
Jack Doe
1
Index
Value
0
John Doe
1
Jill Doe
In pseudo code you may write:
children = array(array("Jane Doe","Jack Doe"),array("John Doe","Jill Doe"));
print children[0][0] . " has a child called " . children[0][1];
Which would return “Jane Doe has a child called Jack Doe”.
A type of operator which uses numbers to assign a value to a variable. It is made up of two operands one of which being your variable, or an operand (your variable) and an expression.
For example, if you were to say x = 3 the letter x is your variable and 3 is your operand. When you then ask the computer to show you the value of variable x/code>, it would return 3.
If instead you were to say x = 3 + 5 the letter x is your variable and 3 + 5 is your expression. The value stored in xwould be 8.
Although they vary in how they are written between languages, the assignment operators are roughly as follows:
Operator
Example
Description
=
x = 4 returns 4
the left value is equal to the right value
+=
x += 3 returns 7 (where x is 4)
the left value is equal to the left value added to the right value
-=
x-= 10 returns -6 (where x is 4)
the left value is equal to the left value subtracted from the right value
*=
x *= 7 returns 28 (where x is 4)
the left value is equal to the left value multiplied by the right value
/=
x /= 3 returns 1.333333333333333 (where x is 4)
the left value is equal to the left value divided by the right value
%=
x %= 3 returns 1 (where x is 4)
the left value is equal to the remainder of the left value divided by the right value