Technical Articles by Srđan Ljuština

Programming Paradigms Series - Article 1: What Are Programming Paradigms?

⏱️ Quick 4-Minute Read

Series Navigation: Article 1 of 7 Next: Imperative Programming →

About This Series

This article series represents my journey of learning and applying fundamental programming concepts to the Dart programming language. These are my detailed notes and insights from the learning process, which I hope will be valuable to others exploring similar topics.


Table of Contents

  1. Introduction
  2. What Are Programming Paradigms?
  3. Programming Paradigms Overview
  4. Key Characteristics

Introduction

Programming paradigms are fundamental approaches to writing software that shape how developers think about and solve problems. Just as architects might approach building design differently depending on whether they’re creating a skyscraper, a bridge, or a home, programmers use different paradigms based on the problem at hand. This article explores the major programming paradigms with practical examples in Dart and relatable real-world analogies.

What Are Programming Paradigms?

A programming paradigm is a style or methodology for structuring and organizing code. It provides a framework for thinking about program design, determining how you express logic, manage data, and handle the flow of execution. Understanding these paradigms helps you choose the right tool for each job and write more effective, maintainable code.

Programming Paradigms Overview

╔═══════════════════════════════════════════════════════════╗
║               PROGRAMMING PARADIGMS FAMILY                ║
╚═══════════════════════════════════════════════════════════╝
                              │
            ┌─────────────────┴─────────────────┐
            │                                   │
   ┌────────▼────────┐                 ┌────────▼────────┐
   │   IMPERATIVE    │                 │   DECLARATIVE   │
   │  Focus: HOW     │                 │  Focus: WHAT    │
   │  Tell me the    │                 │  Describe the   │
   │  steps          │                 │  result         │
   └────────┬────────┘                 └────────┬────────┘
            │                                   │
     ┌──────┴──────┐                            │
     │             │                            │
┌────▼─────┐ ┌─────▼────┐               ┌───────▼───────┐
│PROCEDURAL│ │   OOP    │               │  FUNCTIONAL   │
│Reusable  │ │Model     │               │  Transform    │
│routines  │ │entities  │               │  data         │
└──────────┘ └──────────┘               └───────────────┘

Procedural and object-oriented programming are both imperative styles; functional programming is a declarative style. Modern languages like Dart mix all of them — which is exactly what Article 7 is about.

Key Characteristics

╔════════════╦════════════╦═════════════╦══════════════╦═════════════╗
║ Paradigm   ║ Main Focus ║ Data        ║ Control Flow ║ Best For    ║
║            ║            ║ Handling    ║              ║             ║
╠════════════╬════════════╬═════════════╬══════════════╬═════════════╣
║            ║            ║             ║              ║             ║
║ IMPERATIVE ║    HOW     ║   Mutable   ║   Explicit   ║ Algorithms, ║
║            ║  (Steps)   ║    state    ║    steps     ║   scripts   ║
║            ║            ║             ║              ║             ║
╠════════════╬════════════╬═════════════╬══════════════╬═════════════╣
║            ║            ║             ║              ║             ║
║    OOP     ║  OBJECTS   ║ Encapsulated║   Method     ║  Complex    ║
║            ║ (Entities) ║    state    ║    calls     ║  systems    ║
║            ║            ║             ║              ║             ║
╠════════════╬════════════╬═════════════╬══════════════╬═════════════╣
║            ║            ║             ║              ║             ║
║ FUNCTIONAL ║ FUNCTIONS  ║  Immutable  ║   Function   ║    Data     ║
║            ║(Transform) ║    data     ║ composition  ║ processing  ║
║            ║            ║             ║              ║             ║
╠════════════╬════════════╬═════════════╬══════════════╬═════════════╣
║            ║            ║             ║              ║             ║
║DECLARATIVE ║    WHAT    ║  Abstract   ║   Implicit   ║ UI, queries,║
║            ║  (Result)  ║             ║              ║   configs   ║
║            ║            ║             ║              ║             ║
╠════════════╬════════════╬═════════════╬══════════════╬═════════════╣
║            ║            ║             ║              ║             ║
║PROCEDURAL  ║ PROCEDURES ║   Shared    ║   Function   ║ Sequential  ║
║            ║ (Routines) ║    state    ║    calls     ║    tasks    ║
║            ║            ║             ║              ║             ║
╚════════════╩════════════╩═════════════╩══════════════╩═════════════╝

Each paradigm offers a unique perspective on how to structure and solve problems in code. In the following articles, we’ll explore each paradigm in depth with real-world analogies and practical Dart examples.


Further Reading

Dart Language Resources:

Programming Paradigms:

Community:


👤 About the Author

Srđan Ljuština - Software Developer & Technical Writer

🌐 Website 💼 LinkedIn 💻 GitHub

Series Navigation: Article 1 of 7 Next: Imperative Programming →

Other Articles in This Series: