Software Fundamentals Unlock AI Coding Power

AI amplifies bad code into expensive garbage; use deep modules, shared design concepts, and ubiquitous language to make codebases easy to change and AI-effective.

Code Quality Drives AI Productivity, Not Cheap Specs

Specs-to-code workflows—writing specs, compiling to code via AI, then tweaking specs without touching code—degenerate into garbage because they ignore software entropy. Each iteration produces worse code, as described in The Pragmatic Programmer's chapter on entropy: local changes without system-wide design thinking cause collapse. John Ousterhout's A Philosophy of Software Design defines complexity as structural elements making systems hard to understand or modify; good codebases are easy to change without bugs. 'Code is cheap' is false—bad code is costliest now, blocking AI's full potential. AI excels in good codebases but amplifies flaws in bad ones, making fundamentals like modularity essential.

Deep modules beat shallow ones: deep modules hide vast functionality behind simple interfaces (easy to test and explore), while shallow modules expose tiny functions via complex interfaces (AI struggles to navigate). Restructure shallow codebases by grouping related code into deep modules with controlled interfaces—AI handles implementations inside, humans design boundaries. This enables fast feedback loops (TypeScript, browser access, tests) and reduces cognitive load: treat modules as gray boxes, testing interfaces externally. Result: AI ships more reliably, humans stay sane.

Kent Beck's advice—invest in system design daily—counters specs-to-code divestment; specify module changes in PRDs.

Align AI via Shared Concepts and Language

Failure: AI builds wrong thing due to unshared 'design concept' (ephemeral shared theory from Frederick P. Brooks' The Design of Design). Fix: 'Grill me' skill prompts AI to interview relentlessly (40-100 questions), walking design tree branches to resolve dependencies and align understanding. Viral repo (13k stars) outperforms eager plan modes like Claude Code's; output becomes PRD or issues for AFK agents.

Failure: Verbose, misaligned AI talk. Fix: Domain-Driven Design's ubiquitous language—a markdown of shared terms from codebase scan (tables of terminology). Use consistently in prompts, code, plans: reduces verbosity, aligns implementation to plans (visible in AI thinking traces). Keep open during grilling.

Feedback Loops via TDD and Testable Design

Failure: Code doesn't work despite alignment. Default AI overreaches (outrunning headlights, Pragmatic Programmer), producing huge changes before feedback. Fix: TDD—small steps: test first, pass, refactor. Hard decisions (unit size, mocks, behaviors) ease in testable codebases with deep modules (test simple interfaces).

Even with TypeScript/static types/browser access/automated tests, AI underuses them without structure. Deep modules reward TDD: AI explores easily, feedback tightens iterations. Delegate implementations to AI, design/test interfaces—saves brainpower for non-critical modules.

Summarized by x-ai/grok-4.1-fast via openrouter

7116 input / 1731 output tokens in 13075ms

© 2026 Edge