Programing languages Flashcards
Define a High Level coding language
A computer programming language that resembles natural language or mathematical notation and is designed to reflect the requirements of a problem
What are the advantages of Highlevel languages
- Easier to learn
- Easier to debug
- Easier to write
- Others can understand
- Less complex
Why are High level languages easier to learn
They are closer to the natural language that we use.
High level languages are:
- Python
- Java
- C++
Define source code
A set of instructions that are written in human readable programming language
Define low level languages
A programming language that provides little or no abstraction from a computer’s instruction set architecture
Examples of low level languages are……..
- Machine code
- Assembly language
What is machine code
Aset of instructions that a CPU
understands directly and can act upon. (Binary code)
What are the disadvantages of using a low level language
- Difficult to debug
- Difficult to understand
- Very long(only 1 and 0)
What is Assembly code
A coding language that is a midpoint between high and low level languages
What does Assembly code use
It uses mnemonics- short abbreviations. Each mnemonic directly corresponds with a machine code instruction
What are the advantages of Assembly code
- Easier to read and debug than machine code
- Shorter than machine code
What are the disadvantages of Assembly code
- Still a complex language to understand
- Syntax is difficult to rember
What is opcode
The actual instruction in low level languages
What is operand
The data that the CPU uses in the instruction in low level languages
What is scource code
Code writen in a high level language. It cannot be understood by a computer
What is a translator
A program that converts source code into machine code.
What are the 3 types of translator
- compilers
- interpreters
- assemblers
How do compliers translate
source code
Takes the source code as a whole and translates it into machine code all in one go
What are the advantages of compliers
- Run code quickly (already translated)
- They optimise code
What are the disadvantages of compliers
- The whole code must be retranslated if changes are made
- It cannot be run on other platforms (translated specific to the processor)
How do interpreters translate source code
They translate each instruction separately and the instruction is executed imediately
Advantages of interpreters
- They execute as soon as they are translated (quick)
- Errors can quickly be spotted
Disadvantages of interpreters
- Run slowly (one instruction at a time only)
- Has to be translated everytime its run
- Do not optimise code
How do assembler translators work
They translate one assembly code instruction into one machine code instruction