thecodex.expert  ·  The Codex Family of Knowledge
Section Hub

Programming Paradigms

A paradigm is a way of thinking about and structuring programs. Most languages support several. Understanding paradigms lets you use any language more effectively.

7 paradigms Requires: How Languages Work Last verified:

A paradigm is not a language feature — it is an approach to decomposing problems and organising solutions. Languages tend to favour one or two paradigms but rarely forbid others. Python supports procedural, object-oriented, and functional programming. JavaScript supports all three plus event-driven. Haskell is purely functional. C is mostly procedural.

Knowing a paradigm tells you: how data and behaviour are organised, how the program advances from start to finish, and what the unit of composition is — functions, objects, rules, or events.

The paradigms

Procedural

Programs as sequences of instructions. Data and procedures are separate. State changes through variable assignment. The oldest and most direct model of computation.

Built · Session 04 · Languages: C, Pascal, BASIC, Fortran
Object-Oriented

Programs as interacting objects that bundle data and behaviour. Encapsulation, inheritance, polymorphism. The dominant paradigm in enterprise software since the 1990s.

Built · Session 04 · Languages: Java, C++, Python, Ruby, Kotlin
Functional

Programs as compositions of pure functions. No mutable state. No side effects. Referential transparency. Rooted in lambda calculus and rising in influence.

Built · Session 04 · Languages: Haskell, Erlang, Clojure, F#, Elm
Declarative

Describe what you want, not how to compute it. SQL, HTML, CSS, and Prolog are declarative. The computer figures out the how.

Coming soon · Languages: SQL, HTML/CSS, Terraform, Prolog
Event-Driven

Program flow determined by events — user actions, messages, sensor input. The model behind all GUI frameworks and most server-side architectures.

Coming soon · Languages: JavaScript, Node.js, Java Swing
Reactive

Programs as data flows and propagation of change. Values that automatically update when their dependencies change. Behind spreadsheets, RxJS, and SwiftUI.

Coming soon · Libraries: RxJS, RxJava, ReactiveX
Logic Programming

Programs as logical rules and facts. The runtime searches for solutions that satisfy the constraints. Used in AI, expert systems, and formal verification.

Coming soon · Languages: Prolog, Datalog, Mercury

Most languages are multi-paradigm

A language doesn't have to commit to one paradigm. Most modern languages support several:

LanguageProceduralOOPFunctionalOther
Python✓ (partial)
JavaScript✓ (prototype)✓ (partial)Event-driven
Java✓ (primary)✓ (Java 8+)
Rust✓ (traits)
Haskell✓ (typeclasses)✓ (primary)
C✓ (primary)
SQLDeclarative

Before this section

Compilation Type Systems How Computers Work

After this section

CS Concepts → Language Reference →