rob-pike
Rob Pike's 5 Rules of Programming
The Rules
- You can't tell where a program is going to spend its time. Bottlenecks occur in surprising places. Don't guess — prove it.
- Measure. Don't tune for speed until you've measured. Even then, don't unless one part of the code overwhelms the rest.
- Fancy algorithms are slow when n is small, and n is usually small. Big-O doesn't matter when constants dominate. Use Rule 2 first.
- Fancy algorithms are buggier than simple ones. Use simple algorithms and simple data structures.
- Data dominates. Choose the right data structures and the algorithms become self-evident. "Write stupid code that uses smart objects."
How to Apply
Before Any Optimization
Step 0: Check for Existing Instrumentation
Before asking "have you measured?", determine whether measurement is even possible right now.
Scan the codebase for signs of existing instrumentation:
More from tmdgusya/engineering-discipline
clarification
Use when a user's request is vague, ambiguous, or underspecified. Launches an iterative Q&A loop to resolve ambiguity while a subagent explores the codebase in parallel. Outputs a clear, well-scoped context brief so the user can plan sharply. Triggers on "I want to...", "I need...", "let's build...", "can you help me...", "we should...", or any request where the full scope isn't immediately clear.
36run-plan
Use when you have a written implementation plan to execute. Loads the plan, reviews critically, executes tasks in dependency order, and reports completion. Triggers when the user says "run the plan", "execute the plan", or "let's start implementing".
35systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior. Enforces a strict reproduce-first, root-cause-first, failing-test-first debugging workflow before fixing.
33plan-crafting
Use when a task's scope is clear and multi-step implementation is needed, before touching code. Triggered after clarification is complete, or when the user explicitly requests plan creation with a clear prompt.
32long-run
Orchestrates multi-day execution of complex tasks through milestones. Each milestone goes through plan-crafting, run-plan (worker-validator), and review-work phases with checkpoint/recovery. Triggers when the user says "long run", "start long run", "execute milestones", or "run all milestones".
30simplify
Review changed code for reuse opportunities, quality issues, and inefficiencies using three parallel review agents, then fix any issues found. Triggers when the user says "simplify", "clean up the code", "review the changes", or after run-plan execution when code quality verification is needed.
30