High-level languages

The instructions that tell a computer what to do are written in machine code. Machine code is a series of numbers written in binary. Each number represents a different instruction.

Programmers find machine code difficult to learn, program in and debug. As a result, the majority of programmers write programs in high-level programming languages. These languages are close to natural language - the spoken and written language of humans. For example, Python uses 'print', ‘if’, 'input' and 'while' statements - all words from the English language - to form instructions. In fact, instructions often look like abbreviated English sentences.

Translator program converting high level language into machine code, the key features of each are explained

Compare this simple Python program 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 programming languages are close to natural language spoken and written by humans.

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

Source code is the term given to a set of instructions that are written in human readable programming language. Source code must be translated into machine code before a computer can understand and execute it.