Principles for AI-Assisted Coding
10 Principles for Coding with AI (CHOP: Chat-Oriented Programming)
Video: 10 Principles for Coding with AI Beyond the Basics
Speaker: YK Sugi, Senior AI Developer Advocate, Sourcegraph
Event: Codi Summit
Core Idea
Chat-Oriented Programming (CHOP) treats an AI chat window as the main interface for reading, writing, and reasoning about code. Your leverage comes from supplying the model with the right context at the right moment.
Principles
- Intent + Context + Details + Iteration
- State the goal clearly, provide only the information the AI needs, add concrete details, and refine through tight feedback loops.
- Context Over Clever Prompts
- Carefully curated context boosts accuracy more than exotic prompt tricks.
- Keep Context Concise
- Focused inputs beat giant pastes. Break big problems into a series of small prompts.
- Lean on Core Dev Skills
- Scripting, refactoring, and debugging skills help you shape context and validate AI output.
- Use Retrieval-Augmented Generation (RAG)
- Feed in only the files or lines that matter instead of the whole repo.
- Zoom In on Local Context
- Once you have found the right file or function, keep the prompt scoped to it.
- Blend Multiple Sources
- Combine code, docs, design assets, and chat logs so the AI sees the full picture.
- Go Multimodal and Voice-First
- Add screenshots, diagrams, or voice-to-text notes to frame problems quickly.
- Automate the Drudgery
- Delegate commit messages, boilerplate, renames, and test scaffolds to the AI.
- Augment Search and Navigation
- Ask the AI to locate code, trace call trees, and surface hidden links across tools and repos.
Remember: In CHOP your super-power is context slinging – frame the problem precisely, let the model do the heavy lifting, then confirm with your own engineering judgment.