12.2 Programming Paradigms: Procedural, Object-Oriented, and Others

Key Takeaways

  • Procedural programming organizes a program as a sequence of procedures that operate on data passed to them or stored in variables; key terms include procedure, parameter, return value, local and global variable, and top-down design.
  • Object-oriented programming organizes a program around objects that bundle state (instance variables) with behavior (methods); key terms include class, object, constructor, encapsulation, inheritance, and polymorphism.
  • Functional programming emphasizes pure functions without side effects, immutable data, and passing functions as values.
  • Declarative languages such as SQL describe what result is wanted rather than the steps to compute it.
  • Many languages, including Python, JavaScript, and C++, are multi-paradigm, so the paradigm describes how code is organized, not just which language is used.
Last updated: September 2026

What this competency asks

ETS asks you to be familiar with different programming paradigms:

  1. Identify the terminology of procedural programming.
  2. Identify the terminology of object-oriented programming.
  3. Compare programming paradigms.

The discussion question asks you to describe differences between paradigms such as procedural and object-oriented.

What a paradigm is

A programming paradigm is a fundamental approach to structuring a program: how data and behavior are organized and how computation proceeds. A language may be designed around one paradigm, as Java is around objects, or support several. Python can be written procedurally, in an object-oriented way, or in a functional style.

Procedural programming

Procedural (imperative) programming describes computation as a sequence of statements that change the program's state (its variables), organized into procedures.

TermMeaning
Procedure / function / subroutineA named block of statements that performs a task
Parameter and argumentThe inputs to a procedure and the values passed in
Return valueThe result a procedure sends back
Local and global variablesScope of data (Section 9.1)
Sequence, selection, iterationControl structures
Top-down design / stepwise refinementBreaking the task into procedures, then refining each

Examples: C, Pascal, and early BASIC; also procedural-style code in Python, JavaScript, and the ETS pseudocode.

Strengths: simple to learn, direct control of the steps, and efficient for straightforward tasks and scripts.

Weaknesses: in large programs, data and the procedures that change it are separate, so many procedures may touch the same data, and a change to the data's structure can ripple through the program.

Object-oriented programming (OOP)

OOP organizes a program around objects, which bundle data and the operations on that data.

TermMeaning
ClassA blueprint that defines the data and methods of a type of object
Object / instanceA specific thing created from a class, often with new
Instance variable (field, attribute)Data stored in each object
MethodA procedure defined in a class that operates on an object
ConstructorA special method that initializes a new object
EncapsulationKeeping data private and exposing it only through public methods
InheritanceA subclass (extends) reuses and extends a superclass
PolymorphismThe same method call behaves differently depending on the object's actual class
AbstractionExposing what an object does while hiding how

Examples: Java, C#, C++, Python, and Ruby. Sections 12.3 and 12.4 cover OOP in detail.

Strengths: models real-world entities naturally; encapsulation protects data; inheritance and polymorphism support reuse and extension; and it scales well to large team projects.

Weaknesses: more design effort and code up front, and deep inheritance hierarchies can become rigid.

The same task in two paradigms

Procedural: the data (a balance) and the procedure are separate. The procedure receives the data.

double deposit ( double balance, double amount )
    if ( amount > 0 )
        return balance + amount
    end if
    return balance
end deposit

Object-oriented: the data and its operations live together in a class.

class Account
    private double balance
    public void deposit ( double amount )
        if ( amount > 0 )
            balance ← balance + amount
        end if
    end deposit
end class Account

In the OOP version, only Account's methods can change balance, so the rule "deposits must be positive" is enforced in one place.

Other paradigms to recognize

ParadigmCore ideaKey termsExamples
FunctionalCompute by applying and combining functions; avoid changing statePure function (no side effects), immutability, higher-order function (a function that takes or returns a function), recursion, map / filter / reduceHaskell, Lisp, Scheme; functional features in Python and JavaScript
DeclarativeDescribe what result you want, not how to get itQuery, rule, constraintSQL (SELECT … WHERE …), HTML, spreadsheet formulas
Logic (a kind of declarative)State facts and rules; the system infers answersFact, rule, queryProlog
Event-drivenCode runs in response to eventsEvent, handler, callback, event loopJavaScript interfaces, Scratch, mobile apps (Section 11.1)

Comparing paradigms

QuestionProceduralObject-orientedFunctional
How is code organized?ProceduresClasses and objectsFunctions
Where does data live?Variables and data structures passed to proceduresInside objects, encapsulatedImmutable values passed between functions
How is state changed?By assignment statementsBy methods that change an object's fieldsAvoided; new values are created instead
Main reuse mechanismCalling proceduresInheritance, composition, polymorphismComposing and passing functions
Well suited toScripts, algorithms, small programsLarge systems of interacting entities: games, interfaces, simulationsData transformation, concurrency (no shared state to corrupt)

No paradigm is best for everything. Choose based on the problem, the team, and the language. A program can also mix styles, for example an OOP application whose methods use procedural loops and functional list operations.

Test Your Knowledge

Which set of terms belongs primarily to object-oriented programming?

A
B
C
D
Test Your Knowledge

A program is written as a series of procedures, such as readScores, computeAverage, and printReport, that are called in order from a main routine and pass data to one another through parameters and return values. Which paradigm does this best describe?

A
B
C
D
Test Your Knowledge

A team is building a simulation of a zoo with many kinds of animals. Each kind shares some behaviors (eat, sleep) but has its own version of others (makeSound, move). Which paradigm offers the most natural fit, and why?

A
B
C
D
Test Your Knowledge

The statement SELECT name FROM students WHERE grade = 10 retrieves a list of names without specifying any loop or search algorithm. Which paradigm does it illustrate?

A
B
C
D