Diagram Vocabulary 8 diagram types · Fundamentals of CS · each specimen is interactive

STATUS  exploration
DATE    2026-04-25
FIDELITY wireframe
keys 09

Goal: limit the total number of visualization tools to precisely the number needed — where removing one hurts the ability to express a unique concept, and adding more is only marginally helpful. Three categories, each with one tool.

EEvaluation

how does an expression reduce to a value?

Any function that returns (including operators), switch conditions, recursive calls. The bar-stacking Reduction notation handles all of these in one shape.

"What does this expression equal, and why?"

FFlow

in what order do statements run?

Branching, loops, function call sequences. The question is always which line runs next and how many times. One tool with two modes: branch (fork + merge) and trace (iteration table).

"Which path did execution take?"

MMemory

what does memory look like right now?

Variables, objects, arrays, linked-list nodes, call-stack frames. All one diagram: stack + heap snapshot. Different heap shapes (indexed strip, node chain, object fields) are rendering variations, not separate tools.

"Where does this value live, and who else can see it?"

New tool Absorbs What it no longer needs What would break if removed?
Reduction
bar-stacking
Eval Tree Switch / Match Reduction strip
All are "how does X evaluate to Y?" — one notation with numbered ticks handles arithmetic, function calls, pattern matching, and recursion.
Eval Tree's static tree view (structure of sub-expressions). Covered by the order of the bars — the structure is implicit in which bar sits above which.
Can't show how expressions simplify step by step.
Flow
branch + trace
if / else Loop Trace
Both are "which line runs?" — branching is a one-shot fork; trace is repeated iteration. Two modes, one concept.
Nothing — the two modes cover every control-flow shape in the book.
Can't show which path code takes or how loops iterate.
Memory
stack + heap
Value Memory Ref Types Arrays Linked Lists Call Stack
All are "what does memory look like right now?" — stack slots, heap objects, indexed strips, node chains, and call frames are all shapes drawn in the same stack+heap view.
Separate "Array diagram" and "Linked List diagram" as standalone types. An array is just a heap object with an indexed strip; a linked list is heap objects with next pointers. Same memory view, different shapes.
Can't show where values live, aliasing, or heap structure.
10 old diagrams → 3 tools.  Each tool is irreplaceable — removing any one of the three loses the ability to express a concept no other tool can cover.

Every topic covered by 3 tools

Each row is a topic. The columns show which tool(s) you reach for. Nearly every topic needs exactly 1 or 2 — no topic needs all 3.

Topic Reduction Flow Memory Notes
Variables & assignment
ch. intro
Memory only — stack slots, copy semantics
Arithmetic & operators
expressions
Reduction — bar-stacking for operator precedence
Boolean logic
expressions
Reduction — same notation, boolean operators
if / else
control flow
Flow (branch mode) — condition forks to arms
switch / match
control flow
Reduction — input reduces through arm matching
for / while loops
iteration
Flow (trace mode) — iteration table + Memory for accumulators
Functions & params
functions
Memory (call frames) + Reduction (return value)
Recursion
functions
Reduction (bar-stacking shows unwinding) + Memory (stacked frames)
Classes & objects
OO
Memory — stack refs → heap objects
Aliasing & mutation
OO
Memory — two refs pointing to same heap object
Arrays — indexing
collections
Memory — heap object rendered as indexed strip
Arrays — traversal
collections
Flow (trace) + Memory (array strip with cursor)
Linked lists
collections
Memory (node chain on heap) + Reduction for operations like len()
Sorting / searching
algorithms
Flow (trace) + Memory (array with swaps highlighted)
Exceptions / early return
control flow
Flow (branch — which path exits) + Memory (stack unwinding)

The rule

If you're explaining what something evaluates to → draw a Reduction.

If you're explaining which code runs and in what order → draw a Flow (branch or trace).

If you're explaining what memory looks like → draw a Memory snapshot.

Most topics need 1 tool. Some need 2 side-by-side. None needs all 3.

what we cut

7 diagrams removed, 0 concepts lost

Eval Tree → absorbed by Reduction (bars show structure implicitly).
Switch / Match → absorbed by Reduction (arm matching is evaluation).
Call Stack → absorbed by Memory (frames are stack state).
Value Memory → absorbed by Memory (it's the simple case).
Ref Types → absorbed by Memory (add heap pane).
Arrays → absorbed by Memory (indexed-strip heap shape).
Linked Lists → absorbed by Memory (node-chain heap shape).

what we keep

3 tools, each irreplaceable

Reduction — the only tool that shows step-by-step evaluation. Remove it and you can't explain operator precedence, recursion unwinding, or pattern matching.
Flow — the only tool that shows execution order. Remove it and you can't explain which branch runs, how a loop iterates, or when code exits early.
Memory — the only tool that shows state. Remove it and you can't explain where values live, aliasing, or heap structure.