Anti-Patterns - What Doesn't Work
Learn from our mistakes - five common anti-patterns to avoid when using AI for development
Learn from our mistakes.
Anti-Pattern 1: Blind Acceptance
Mistake: "AI is smart, I'll just accept everything."
Reality: AI makes plausible mistakes.
Example from real project:
// AI generated
async function deleteUser(userId: string) {
await db.users.delete({ id: userId });
// Looks fine, ships to production
}
// Problem: No cascading deletes
// User deleted, but their orders, preferences, sessions remain
// Database integrity violatedLesson: Always ask "What could go wrong?" before merging.
Anti-Pattern 2: Over-Engineering
Mistake: Asking AI to build "scalable, production-ready, enterprise-grade" solution for simple problem.
What happens:
- AI generates 500 lines of abstractions
- Multiple design patterns stacked
- Harder to maintain than simple solution
Example:
Bad prompt: "Create enterprise-grade user service with repository pattern,
CQRS, event sourcing, and microservices architecture"
For: A simple CRUD app with 100 users
Good prompt: "Create simple UserService with:
- findById, create, update, delete
- Basic validation
- Follow patterns from @src/orders/OrderService.ts"Lesson: Start simple. Add complexity when needed, not preemptively.
Anti-Pattern 3: Skipping the Understanding Phase
Mistake: Generate code → copy/paste → commit → merge
Why it fails:
- Can't debug when it breaks
- Can't explain to teammates
- Can't modify when requirements change
Real case from Client A: Developer used AI to implement payment processing. Code worked in development. Failed in production due to timezone handling. Developer couldn't debug because didn't understand the code.
Better approach:
You: "I need to implement payment processing. First, explain:
1. What are the key security considerations?
2. What error cases should I handle?
3. What testing strategy do you recommend?
Then we'll implement together, step by step."Lesson: AI is a collaborator, not a replacement for thinking.
Anti-Pattern 4: Context Overload
Mistake: Dumping entire codebase into context.
Example:
"Here's all 50 files in @src/, analyze everything and fix all bugs"Why it fails:
- AI gets confused with too much context
- Misses important details
- Suggestions are generic
- Slow and expensive
Better approach:
"Focus on @src/orders/OrderService.ts
Specific issue: calculateTotal() returns wrong amount when discount applied
Related files:
@src/orders/models/Order.ts
@src/promotions/DiscountCalculator.ts
Help me debug."Lesson: Be surgical with context. Quality over quantity.
Anti-Pattern 5: Using AI for Everything
Things AI does poorly:
- Architectural decisions (use AI for analysis, human for decision)
- Security threat modeling (AI helps, humans must verify)
- Business logic validation (AI doesn't know your business)
- Political/interpersonal code review (use human judgment)
Example:
Good:
"Should we use microservices or monolith for [specific requirements]?
Analyze trade-offs."
[AI provides analysis]
[Human makes decision based on business context AI doesn't have]Bad:
"Should we use microservices or monolith? Decide for us."
[AI picks one]
[Team commits without considering business context]Lesson: AI augments decisions, doesn't make them.