---
id: "framework-rob-pike-agent-rules"
type: "framework"
source_timestamps: ["00:05:45", "00:09:28"]
tags: ["software-engineering", "best-practices", "system-design"]
related: ["concept-data-dominated-agent-design", "claim-fancy-algorithms-fail-agents", "entity-rob-pike"]
steps: ["Do not guess where the agent system will bottleneck; wait for evidence.", "Establish baseline measurements of agent performance before attempting any optimization.", "Avoid complex agent architectures (fancy algorithms) for tasks with small scope.", "Simplify agent designs to ensure they remain debuggable and maintainable.", "\"Prioritize clean", "structured data engineering over complex prompt engineering.\""]
sources: ["s41-nvidia-open-sourced"]
sourceVaultSlug: "s41-nvidia-open-sourced"
originDay: 41
---
# Rob Pike's 5 Rules of Programming (Applied to Agents)

## Framework Origin

[[entity-rob-pike]] (co-creator of Unix and Go) wrote his **5 Rules of Programming** decades ago. [[entity-nate-b-jones]] argues these are precisely the rules modern AI agent developers need to adopt. The rules are the operational backbone for [[contrarian-agent-engineering-is-not-new]].

## The Five Rules — Adapted

### Rule 1: You can't tell where a program is going to spend its time
> **Agent translation:** Do not guess where your agent pipeline will bottleneck. Use speed hacks until proven otherwise; let actual measurements drive optimization.

### Rule 2: Measure. Don't tune for speed until you've measured
> **Agent translation:** Do not optimize prompts, model selection, or agent speed until you have established a baseline measurement of performance.

Operationalized as [[action-measure-before-optimizing]].

### Rule 3: Fancy algorithms are slow when N is small
> **Agent translation:** Do not use complex multi-agent architectures for simple tasks. Simple architectures scale better in production.

### Rule 4: Fancy algorithms are buggier than simple ones
> **Agent translation:** Complex agent prompts and massive context graphs are nearly impossible to debug. Simplify to maintain observability.

Rules 3 and 4 together are the basis for [[claim-fancy-algorithms-fail-agents]] and the action [[action-simplify-agent-architecture]]. See also [[quote-dont-get-fancy]].

### Rule 5: Data dominates
> **Agent translation:** If you choose the right data structures, the agent's algorithm/prompt will be self-evident. Data engineering > prompt engineering.

See [[concept-data-dominated-agent-design]], [[claim-data-engineering-over-prompting]], [[quote-data-dominates]].

## How to Apply (Sequence)

1. **Don't guess** where the agent will bottleneck.
2. **Measure** baseline performance first.
3. **Avoid fancy architectures** for small-N tasks.
4. **Simplify** for debuggability.
5. **Invest in data engineering** above prompt engineering.

## Adjacent Literature

Google's *Rules of Machine Learning* parallels Pike's structure — measurement over fancy models, data primacy first. Both can be read together.

## See Also

- [[entity-rob-pike]] — the author
- [[contrarian-agent-engineering-is-not-new]] — the philosophical frame
- [[framework-factory-agent-readiness]] — the operational counterpart for environments
