1. High-Level vs. Low-Level Languages
A program is a set of instructions that tells a computer what to do. At their core, computers only understand 'machine code', which is made of binary ones and zeros. This is a low-level language because it is very close to the computer's hardware and difficult for humans to read or write. To make programming easier, we use high-level languages like Python, Java, or Scratch. These use English-like words and syntax, making them easier to learn and understand. High-level languages must be translated into low-level machine code before the computer can execute them. This translation is done by special programs called compilers or interpreters. Block-based languages (like Scratch) are a visual type of high-level language, while text-based languages (like Python) require you to type the code.
Key term
Examiner insight
Common pitfall
Worked example 14 marks
Compare two features of a high-level programming language like Python with a low-level language like machine code.
- 1
Feature 1: Readability. High-level languages use English-like keywords (e.g., 'print', 'if') and syntax, making them easy for humans to read, write, and maintain. Low-level languages consist of binary or hexadecimal codes, which are very difficult for humans to understand.
- 2
Feature 2: Portability. High-level language programs can be run on different types of computers with little or no modification. Low-level language programs are specific to one type of processor architecture and are not portable.
Recap
- Computers only understand low-level machine code (binary).
- High-level languages use English-like commands and are easier for humans to use.
- Examples of high-level languages include Python (text-based) and Scratch (block-based).
- High-level code must be translated into machine code using a compiler or interpreter.
- Low-level languages are hardware-specific, while high-level languages are generally portable.
Quick check
- State one advantage of writing a program in a high-level language compared to a low-level language.1 mark
- What is the name of the program that translates high-level code into machine code?1 mark