1.2.4a Programming Pardigms Flashcards
What is a programming paradigm? What are the broad categories of them?
Different approaches to using a programming language to solve a problem.
The broad categories are Imperative and Declarative.
What are the 2 Imperative programming languages? What are their main features?
Imperative uses code that specifies the actions to be performed to solve the problem.
Procedural => Uses a sequence of instructions that may be contained within procedures, e.g. Pascal, Python.
OOP => Built on entities called objects contained within classes that have certain methods and attributes, e.g. C#, Java.
What is the main Declarative programming language? What are its main features?
Declarative states the desired result and the programming language determines how to obtain this.
Logical => Uses code that defines a set of facts on rules based on the problem, and queries are used to find solutions, e.g. SQL.
What is the function of an addressing mode? What do each of them do?
They specify how the operand should be interpreted.
Immediate=> The operand is the actual value to be operated on.
Direct=> The operand holds the address of the value to be operated on.
Indirect => The operand holds the address of the address of the value to be operated on.
Indexed => The value of the operand is added to the index register which gives the address of the value to be operated on.