Programming paradigms — AQA A-Level Computer Science
Programming paradigms are fundamental styles or approaches to software design and problem-solving, primarily categorised into imperative (procedural, object-oriented) and declarative (functional, logic) paradigms. AQA A-Level Computer Science requires students to understand the characteristics, syntax constructs, and trade-offs of procedural, object-oriented, assembly, and functional programming.
Programming paradigms explained
A programming paradigm is a style of programming that shapes how a problem is modelled and how a program is structured.
Read the full explanation
Procedural programming organises a program as a sequence of procedures or subroutines that operate on data, typically passing data between them as parameters and often using global or shared variables; it suits problems that can be expressed as a series of steps. Object-oriented programming organises a program around objects, which bundle data (attributes) and the operations that act on that data (methods) into a single unit defined by a class; key characteristics include encapsulation, inheritance and polymorphism. For example, a procedural program might use a function calculateArea(width, height) acting on separate variables, whereas an object-oriented program might define a Rectangle class with width and height attributes and an area() method.
Your focus
- Understand the characteristics of the procedural- and object-oriented programming paradigms, and have experience of
Which command word is this?
Set out the causes, reasons, or mechanics of a concept using precise technical terms. For instance, explaining polymorphism requires mentioning subclassing, overriding base class methods, and dynamic execution at runtime.
Programming paradigms exam tips
Topic Overview
Programming paradigms dictate the fundamental conceptual model used to formulate and guide the execution of computer programs. The AQA specification categorises paradigms into imperative styles (including procedural and object-oriented programming) which focus on how steps alter machine state, and declarative styles (specifically functional programming) which focus on what computation to express.
Mastering paradigms allows software engineers to select the optimal design pattern for a given domain, balancing concerns such as concurrency, maintainability, memory footprint, and code reuse. This unit directly links theoretical algorithmic design with real-world language selection, low-level assembly execution, and object-oriented systems.
Key Concepts
- →Procedural Programming: Code structured into subroutines, procedures, and functions that manipulate mutable state sequentially using variables, selection, and iteration.
- →Object-Oriented Programming (OOP): Programs structured around collaborating objects combining state (attributes) and behaviour (methods), governed by encapsulation, inheritance, and polymorphism.
- →Functional Programming: A declarative paradigm treating computation as the evaluation of mathematical functions, prioritising immutable data structures, pure functions, first-class functions, and recursion over assignment statements.
- →Low-Level / Assembly Paradigm: Direct hardware-level programming using mnemonics corresponding to CPU machine instructions, explicit register manipulation, and memory addressing modes.
Marking Points
- Describes procedural programming as organised around procedures acting on data
- Describes object-oriented programming as organised around objects combining attributes and methods
- Identifies encapsulation, inheritance or polymorphism as characteristics of object-oriented programming
- Gives an example of a problem suited to each paradigm
- Demonstrates practical experience by writing or modifying a program in each style
Examiner Tips
- 💡Use the terms procedure, object, class, attribute and method precisely in answers
- 💡Support each characteristic with a short example from code rather than general description
- 💡Compare the two paradigms by contrasting how data and operations are grouped
- 💡When drawing UML class diagrams for OOP questions, ensure you use the exact AQA standard symbols: '+' for public attributes/methods, '-' for private, and '#' for protected, with an open triangle pointing to the superclass for inheritance.
- 💡In functional programming questions, look out for higher-order functions such as 'map', 'filter', and 'reduce/fold'; be prepared to write or trace list definitions using head and tail notation (e.g. x:xs).
- 💡Distinguish clearly between class definitions (the blueprint/template) and instantiated objects (the concrete instance existing in memory at runtime).
Common Mistakes
- Describes object-oriented programming simply as using more code, without naming its characteristics; name encapsulation, inheritance or polymorphism
- Confuses a class with an object, so the class is described as holding specific data values; a class is a template and an object is an instance of it
- Treats the statement as theory only, so no practical experience is evidenced; include writing or amending code in each paradigm
- Believing functional programming languages cannot perform input/output or change screens because data is strictly immutable. (Correction: Functional programs isolate side effects into dedicated structures (such as monads in Haskell) rather than eliminating I/O entirely; pure functions remain mathematically predictable without unmanaged side effects.)
- Treating inheritance as merely a tool to avoid retyping code. (Correction: Inheritance establishes an 'is-a' relationship allowing behavioural polymorphism and interface consistency; misuse for mere code-sharing leads to fragile and tightly coupled base-class dependencies.)
- Confusing private attributes with total cryptographic security. (Correction: Access modifiers like 'private' protect architectural encapsulation and prevent unintended runtime mutations by client code; they are compiler/runtime safety boundaries, not encryption mechanisms.)
Revision Plan
- 1Step 1: Solidify OOP principles (Encapsulation, Inheritance, Polymorphism, Composition vs Aggregation) by writing code implementations and UML diagrams.
- 2Step 2: Compare procedural mechanics with OOP to master typical comparison essay questions regarding maintainability, reusability, and modularity.
- 3Step 3: Practice functional programming concepts: write pure functions, trace higher-order functions ('map', 'filter'), and trace recursive list processing.
- 4Step 4: Review assembly language paradigms, addressing modes (immediate, direct, indirect, indexed), and typical Little Man Computer or AQA assembly instruction sets.
- 5Step 5: Complete past paper questions focusing on 6-mark paradigm comparison questions and functional list trace questions.
Exam Question Types
- 📋UML and OOP Design Questions: Constructing or interpreting class diagrams and translating class specifications into working pseudocode or Python.
- 📋Paradigm Comparison Essays (6-9 marks): Evaluating procedural vs object-oriented or functional paradigms for a specific scenario (e.g. concurrent servers or graphical user interfaces).
- 📋Functional Trace & Expression Questions: Evaluating functional expressions involving recursion, higher-order functions, and list operations.
Command Word Expectations (AQA)
Set out the causes, reasons, or mechanics of a concept using precise technical terms. For instance, explaining polymorphism requires mentioning subclassing, overriding base class methods, and dynamic execution at runtime.
Identify both similarities and differences between two paradigms or mechanisms (e.g. composition vs aggregation), directly pairing corresponding features rather than writing two disconnected descriptions.
Weigh the relative strengths, limitations, and suitability of two or more paradigms for a given scenario, concluding with a reasoned, justified recommendation.
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: A logistics system stores delivery vehicles. Define an abstract base class 'Vehicle' in pseudocode or Python with private attributes 'registration' and 'mileage', a constructor, and a polymorphic method 'calculateServiceCost()'. Then define a subclass 'Van' with an extra private attribute 'payloadKg' that overrides 'calculateServiceCost()'.
- 1.Step 1: Declare the base class 'Vehicle' with a constructor initialising private attributes '__registration' (string) and '__mileage' (float/integer).
- 2.Step 2: Add getter methods for private attributes to respect encapsulation and declare 'calculateServiceCost()' (as an abstract method or default implementation).
- 3.Step 3: Define subclass 'Van' inheriting from 'Vehicle', invoking the superclass constructor via super() for 'registration' and 'mileage', and initialising '__payloadKg'.
- 4.Step 4: Implement the overridden method 'calculateServiceCost()' within 'Van' using its specific calculation logic (e.g. baseline charge plus mileage and payload factor).
Question: Explain two key differences between the imperative (procedural) paradigm and the functional programming paradigm. [4 marks]
- 1.Step 1: Identify the fundamental difference in execution model and state (stateful vs stateless).
- 2.Step 2: Contrast procedural sequential statements modifying shared mutable state with functional pure mathematical functions having no side effects.
- 3.Step 3: Identify the difference in iteration mechanisms (loops vs recursion).
- 4.Step 4: Formulate precise comparative sentences using technical terminology.