High level languages
The instructionA single action that can be performed by a computer processor. that tell a computer what to do are written in machine codeAlso called object-code, this is low-level code that represents how computer hardware and CPUs understand instructions. It is represented by either binary or hexadecimal numbers. . Machine code is a series of numbers, written in either binaryA number system that contains two symbols, 0 and 1. Also known as base 2. or hexadecimalA number system using 16 symbols from 0-9 and A-F, also known as base 16 and hex.. Each number represents a different instruction.
Programmers find machine code difficult to learn, program in and debugThe process of finding and correcting programming errors. . As a result, the majority of programmers write programs in high-level languageAlso known as high level language. This is a computer programming language used to write programs. High-level languages need to be translated into machine code through a compiler, interpreter or assembler.. These languages are close to the spoken and written language of the programmer. For example, PythonA high-level programming language. uses 'print
', 鈥if
鈥, 'input
' and 'while
' statementThe smallest element of a programming language which expresses an action to be carried out. - all words from the English language - to form instructions. In fact, instructions often look like abbreviated English sentences.
Compare this simple Python programSequences of instructions for a computer. with its comments that are written in English:
while count < 10:
#While the value of count is less than ten
number = int(input("Type in a number"))
聽聽聽聽#Input a number
total = total + number
聽聽聽聽#Add the number to the total
count = count + 1
聽聽聽聽#Add one to the value of count
print("The total is ", total)
#Print out the total
Programmers write in high level languages because they are easier to understand and are less complex than machine code. They allow the programmer to focus on what needs to be done, rather than on how the computer actually works.
For example, in many high level languages, to place a message on the screen, a programmer would use the statement 'print
'. The programmer might not know how the computer actually generates the message. They just need to know how to use the 'print
' statement.
High level languages have a disadvantage - they are restricted to the number of statements built into them. If the programmer wants a program to do something, but a statement does not exist to do so, the task cannot be done.
Commonly used high level languages
Many types of high level language exist and are in common use today, including:
- Python
- Java
- C++
- C#
- Visual Basic
- JavaScript
Source code
Any program written in a high level language is known as source codeThe code behind a computer program, written in a programming language.. Source code must be translated into machine code before the computer can understand and execute it.
High level languages are known as one-to-many languages as each high level instruction is translated into many machine code instructions.