- Human Language
- Programming Language
- Machine Language
Human language is your native tongue. If English is the first language you learned, then English is your native language.
Machine language is the language of computers. Essentially all computers use the binary number system as their language. Programs, pictures, books, music, and data are stored as a series of ones (1) and zeros (o). Ones (1) signify ON or TRUE while zeros (0) signify OFF or FALSE.
In the binary number system, a single 1 or 0 is called a bit. Bits are usually organized into groups of 8 called bytes.
Example byte: 1100 0011
- 1 kilobit is 1000 bits.
- 1 kilobyte is 1000 bytes.
- 1 kilobyte is 8000 bits or 8 kilobits.
Pseudocode is organized much like a programming language, but is intended for human reading rather than machine reading. It is used for designing and outlining programs in an easy to read/understand manner. Because pseudocode is organized like a programming language, it is relatively easy to move from pseudocode to a proper programming language. The rules for pseudocode are determined by whoever is doing the programming (or perhaps their boss), but these rules frequently resemble rules for a common language like C, Python, or BASIC.
Functions are named sections of a program. There are used in the process of breaking down a complex program into simpler pieces. These smaller pieces are variously called functions, methods, subprograms, routines, and subroutines. Breaking down a complex problem allows for better planning, organization, and easier results. A program which has been broken into logical pieces is also easier to read, fix, modify, and extend.
You can read all about breaking down problems here.
The syntax of a computer language is the set of rules that defines how a working program must be written in order for the computer to execute it. A syntax error will result in a program which does not function at all.
Style is the set of rules or guidelines for appearance and neatness used when writing the source code for a computer program. The style of a computer language is the set of best practices used to make a program easily readable by humans. A program with style errors may still function correctly, but it will be hard for people to read. Examples of such errors include non-descriptive names for functions and variables, lack of whitespace, poor use of functions (decomposition), and lack of comments.
camelCase is a naming convention used in many languages to ensure good style. A name written in camelCase will start with a lower case letter. Each consecutive word will start with an uppercase letter. The result is a name that looks like myFavoriteFood or cleanKitchen. In the STEAM Lab, all variables and functions must be named using camelCase.
Variables are named pieces of data. They can come in many shapes and sizes, but their purpose is to hold data which may change in value. For example, the temperature outside is changeable and might be stored in a variable called tempOutside.
- tempOutside = 32.14 degrees Farenheit (the temperature is always changing)
- numberOfStudents = 31 (every class in the STEAM Lab has a different number of students)
- currentScore = 12 (hopefully you’ll keep scoring more points)
Constants are named pieces of data. They can come in many shapes and sizes, but their purpose is to hold data which can never change in value. For example, the speed of light is a value which never varies and might be stored in a constant called speedOfLight.
- absoluteZero = -273.15 degrees Celsius (Nothing can be colder than this. This is constant)
- speedOfLight = 299,792,458 meters per second (Nothing travels faster than this.)
- pi = 3.1415… (missing a few decimal places, but Pi never changes)
Loops are a sequence of instructions that are continually repeated until a certain condition is reached. The code (sequence of instructions) may be repeated a specific or infinite number of times. In Scratch, there are forever, repeat until, and do x times loops. Code inside the block of a loop, will be repeated dependent on the type of loop and conditions used.
Conditionals are a critical feature in a programming languages which allow code to be executed under only some circumstances. Code inside the block of a conditional will only execute if the condition is TRUE.
In this code example, when “tempOutside > 72” is TRUE, the air conditioning will turn on. Otherwise, the heater is on.
Boolean is the name for an expression which can only be TRUE or FALSE.