lantern

spatial-software-engineering-patterns

Spatial Software Engineering Patterns πŸ•ΉοΈ

Mental models for algorithms and architectures using spatial metaphors from classic video games and fairy tales.

The Patterns

Why Spatial Metaphors?

Because they stick. When you're debugging at 2am and need to remember how template resolution works, "E.T.-ing out of a pit" is a lot more memorable than "iterative innermost-first bottom-up evaluation."

They map to experience. Everyone knows Space Invaders wiggle left-to-right. That's breadth-first search. Your brain already has the spatial intuition - we're just naming it.

They create shared language. "Are we Hansel-and-Gretel-ing this or Space-Invaders-ing it?" becomes a legitimate architectural question with a clear answer.

The Meta-Pattern

All of these are ways of traversing or organizing graphs:

  • Hansel & Gretel: Depth-first with memory (breadcrumb trail)
  • E.T.: Bottom-up from leaves to root (climb out of pit)
  • Space Invaders: Breadth-first by level (row-by-row)
  • Galaga: Parallel graph structures (side trees)
  • Minotaur's String: Recursion depth tracking (detect circles)
  • Teapot Grannies: Conversation as protocol (competent computing)

Different problems need different traversal patterns. Pick the one that fits the shape of your data and the order you need to process it.

Note: Hansel & Gretel vs Minotaur's String - Both track where you've been, but H&G is for backtracking (finding your way back), while Minotaur is for loop detection (knowing you're going in circles).

tags

tags: [documentation, patterns, algorithms, mental-models, architecture]

North

slots: []

East

slots:
- sprouting-pattern
- queer-parameters
- scaveger-hunt-pattern
- fairy-tale-spatial-exceptions
- context:
  - Sibling pattern collections - algorithms and databases
  slug: spatial-database-engineering-patterns

South

slots:
- standing-on-shoulders-pattern
- lottery-ticket-pattern
- minotaurs-string-pattern
- edge-extraction-pattern
- no-prisoners-pattern
- teapot-grannies-pattern
- doctors-companions-protocol
- blooming-onion-pattern

West

slots:
  - node: my-special-things