{
  "schema_version": "1.0",
  "codex": "thecodex.expert/coding",
  "type": "concept",
  "slug": "concepts/control-flow",
  "name": "Control Flow",
  "section": "CS Concepts",
  "canonical_definition": "Control flow refers to the order in which individual statements, instructions, and function calls are executed in a program \u2014 structured through conditional statements (if/else, switch/match) that select which branch of code executes based on the truth value of an expression, as opposed to the default sequential execution from top to bottom.",
  "confidence": "high",
  "last_verified": "2026-06-01",
  "source_count": 4,
  "url": "https://thecodex.expert/coding/concepts/control-flow/",
  "concept_relationship": {
    "requires_first": [
      "concepts/operators",
      "concepts/data-types"
    ],
    "enables": [
      "concepts/loops",
      "concepts/functions",
      "paradigms/procedural"
    ],
    "commonly_confused_with": [
      "= vs. ==; switch fall-through (C/JS) vs. no fall-through (Python match); elif chain vs. if chain"
    ]
  },
  "sources": [
    {
      "num": 1,
      "citation": "Dijkstra CACM 1968",
      "tier": 1
    },
    {
      "num": 2,
      "citation": "Python PEP 634",
      "tier": 1
    },
    {
      "num": 3,
      "citation": "Rust Reference \u00a78.9",
      "tier": 1
    },
    {
      "num": 4,
      "citation": "ISO C17 \u00a76.8",
      "tier": 1
    }
  ]
}