1.2.4 Types of language Flashcards
(6 cards)
Programming paradigms
Imperative:
Procedural
Object-Oriented
Declarative:
Functional
Logic
Imperative
Procedural:
() Written as sequence of intructions
() Easy to write an interpret
+ Easy to write and understand
Object-Oriented:
() Suited to problems which can be broken down into reusable components
() Based on objects formed from classes
Declaritive
() State the result, then the program detirmines how best to obtain this result
() Details about obtainedness are abstracted from user
Functional:
() Functions form the core of the program
() Closely linked to mathmatics
Logic:
() Set of facts and rules based on how the program is defined
() Queries are used to find answers
Procedural eval:
+ Clear flow
+ Easy to implement algorithms
- Not ideal for large scale projects: can’t manage complex behaviours, managing it becomes hard as it grows
Assembly
Low level (next up from machine code)
Uses mneonics
Commands are processor specific
Each line is equivilent to one line of machine code
Modes of addressing
Opcode: Specifices instruction
Operand: Specifices data
Addressing mode specifies how the operand should be interpreted
Immediate: Operand is the actual value
Direct: Address of operand is given
Indirect: Address of reigster which holds another address where data is located
Indexed: Index register is used