1.2.4 Types of Programming Techniques Flashcards
What is a programming paradigm?
- To describe an example of a pattern
- To describe an example of a way of doing things
Machine code (4)
- Least abstract
- Closest to what happens on a computer
- Programs directly in 1s and 0s
- These translate into matching electrical signals e.g. 1 for high voltage and 0 for lo
Assembly language (4)
- Low level language that uses short code (mnemonics)
- Each mnemonic matches a specific sequence of 1s and 0s
- One-to-one relationship
- Written in assembly language and translated by a specific assembler
High Level language
- Written in the language that is designed to be easily understood by humans
- Uses syntax that is similar to human language to form instructions
- Must be translated into machine code before it can be run (compilation)
Features of procedural languages
- Focus on telling a computer exactly what to do by way of step-by-step instructions
- Lay code as a series of statements (SSI)
- Code is developed in a modular way using functions and procedures
Features of procedural languages
- Pre defined functions
- Local variables
- Global variables
- Parameter passing
- Modularity
- Procedures
- Library
What are pre defined functions?
Functions pre-written within a programming language
What are local variables?
A variable that can only be accessed within the specific function or procedure it was declared in
What are global variables?
A variable that can be accessed throughout the whole program and used by all modules
What is parameter passing?
Allows variable values to be passed into procedures and functions for use in those blocks of code
What is modularity?
The concept of separating the functionality of a program into individual, interchangeable blocks, each designed to carry out a single task
- These all combine to make a complete program and make the program more readable
What is a library?
A collection of pre-built functions and procedures that can be linked and used y a programmer in their own code
LMC: ADD
Add
LMC: SUB
Subtract
LMC: STA
Store