Programming languages - EdexcelHigh-level languages

Programming languages are classified as high-level or low-level languages. Translators are needed to translate programs into the machine code that a computer understands. Different languages are more suitable for different tasks.

Part ofComputer SciencePrinciples of computer science

High-level languages

The characteristics and purposes of high-level languages

Programmers find very difficult to learn, write and . As a result, the majority of programmers write in . These languages use English-like statements. For example, uses 'print', ‘if’, 'input' and 'while' - all words from the English language - to form . In fact, high-level program instructions often look like abbreviated English sentences.

Translator program converting high level language into machine code, the key features of each are explained
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 and loop back to while

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 enable 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, programmers 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.

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.NET
  • PHP

Most high-level languages can be used for different purposes, but are best used for the purpose they were created. For example, PHP was created for web development.

Source code

is the term given to a that are written in human-readable programming language. The Python program shown before is an example of source code. This code must be into machine code before the computer can understand and execute it.