Common Mistakes
Antipatterns that slow you down or cause problems.
1. The "Just Make It Work" Trap
Problem: Accepting AI code without understanding it.
🚫
If you can't explain what the code does, don't ship it.
Fix:
- Read every function
- Ask AI to explain unclear parts
- Add comments for complex logic
2. The Infinite Loop
Problem: AI keeps generating similar wrong solutions.
Signs:
- Same error keeps appearing
- AI apologizes and makes the same mistake
- You've been at this for 20 minutes
Fix:
- Stop and rethink your approach
- Provide more constraints
- Start a new chat
- Write the tricky part yourself
3. Over-Engineering
Problem: AI loves adding abstractions you don't need.
Fix: Explicitly ask for simple solutions:
"Give me the simplest possible implementation.
No abstractions. I can refactor later if needed."4. Dependency Bloat
Problem: AI adds npm packages for things you could do in 10 lines.
import { formatDate } from 'date-fns';
import { debounce } from 'lodash';
import { v4 as uuid } from 'uuid';Fix:
- Ask: "Can this be done without adding a dependency?"
- Review every
importfrom external packages - Each dependency = security risk + maintenance burden
5. Single Responsibility Violations
Problem: AI creates god-functions that do too much.
// ❌ AI might generate this monolith
function handleUserRegistration(data) {
// validate, hash password, save to db,
// send email, log analytics...
// 200 lines of everything
}
// ✅ What you want
function validateRegistrationData(data) { /* ... */ }
function hashPassword(password) { /* ... */ }
function saveUser(userData) { /* ... */ }
function sendWelcomeEmail(user) { /* ... */ }Fix: Ask for focused functions:
"Split this into smaller functions. Each function should do ONE thing."6. Context Contamination
Problem: Long chats where AI "forgets" early decisions.
Fix:
- Summarize decisions periodically
- Reference files directly
- Start fresh for new features
7. The Copy-Paste Cascade
Problem: Copy-pasting AI suggestions without reading.
⚠️
AI makes subtle errors:
- Wrong variable names
- Incorrect imports
- Missing error handling
- Security vulnerabilities
Fix: Read every line. Trust but verify.