9hills' six patterns for AI coding: linear beats nested, real deps beat mocks
dotey · x · 2026-12-04
9hills lays out six patterns and anti-patterns for coding in the AI era:
- Linear over nested: 100 flat if-else branches are easier for models than deep nesting
- Cohesion over splitting: tiny functions/files force more tool calls and hurt comprehension
- Code over comments: self-explanatory code, only a few why-comments
- Lint over conventions: move prompt conventions into linters where possible
- Exposure over hiding: default parameter values built for human cognitive limits are no longer needed
- Real tests over mocks: point unit tests at real dependencies (e.g. a standalone db), test behavior not implementation, and keep test counts low
More from coding & agent
- startupcredits.fyi aggregates 124 programs worth $3M in free startup credits — sahilypatel · 2026-12-04
- Codex CLI now supports OpenAI Cloud with a single `codex --cloud` command — dkundel · 2026-12-04
- 4M-context Grok looping produced a legal filing for $12, saving ~$100k in prep — ryanallred · 2026-12-04
- A Gen-Z student runs versioned Agents.md with test cases for every AI project — huangyun_122 · 2026-12-04
- Building a support agent made me fix my documentation first — the real work isn't the prompt — Wise_Typer_20 · 2026-12-04
- Building a read-only post-deploy MCP server: untrusted content fencing and OAuth 2.1 lessons — CorchesRares2804 · 2026-12-04