Catalypt LogoCatalypt.ai

Industry Focus

Developer Options

Resources

Back to Blog

Pair Programming With AI: The Good, The Bad, The Hallucinated

2025-07-10T00:00:00.000Z Catalypt AI Team ai-first

"It's like having a senior developer always available!" That's what they told me about AI pair programming. What they didn't mention: this senior developer sometimes forgets what language we're using and occasionally invents entire frameworks.

After a year of daily AI pairing, here's the real story.

The Honeymoon Phase

Week 1 with Copilot/Claude/Cursor was magical:

  • Autocompleting entire functions!
  • Writing perfect boilerplate!
  • Suggesting variable names that make sense!
  • I'm 10x more productive!

Week 2 reality check:

  • Autocompleted a function that calls non-existent APIs
  • Suggested we import from 'react-native' in a web app
  • Confidently used a Python decorator in JavaScript
  • I'm now debugging AI mistakes at 2x speed

The Hallucination Hall of Fame

Real AI suggestions from my pairing sessions:

// The "Framework Inventor"
// Me: Using React 18
// AI: "Let me import from React 19's new useFantasy hook!"
import { useFantasy } from 'react';

function MyComponent() {
  const dreams = useFantasy(() => {
    // This hook doesn't exist, but AI was confident
    return "All your state management problems solved";
  });
}
// The "Wrong Language Enthusiast"
// In a JavaScript file:
class UserService:
    def __init__(self):
        self.users = []
    
    def add_user(self, user):
        # AI forgot we're not in Python
        self.users.append(user)
// The "Time Traveler"
// AI suggested using APIs from the future
const result = await fetch('/api/v3/quantum-users', {
  method: 'THINK',  // New HTTP verb from 2025
  headers: {
    'X-Telepathy': 'enabled',
    'Content-Type': 'application/thoughts'
  }
});
// The "Infinite Recursion Optimist"
function factorial(n) {
  // AI's solution
  return factorial(n - 1) * n;
  // Me: "What about the base case?"
  // AI: "Base cases are for pessimists"
}
// The "Security Nihilist"
app.post('/api/admin/*', (req, res) => {
  // AI's auth implementation
  // "Trust-based security is the future"
  executeAdminFunction(req.params[0], req.body);
  res.json({ success: true, message: "YOLO" });
});

"Write a regex for email validation" - AI is faster than Stack Overflow "Implement quicksort" - Perfect every time "Parse this weird date format" - Actually helpful

// What AI is actually GOOD at:
// Boilerplate REST endpoints
app.get('/api/users/:id', async (req, res) => {
  try {
    const user = await User.findById(req.params.id);
    if (!user) {
      return res.status(404).json({ error: 'User not found' });
    }
    res.json(user);
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});
// Business Logic Disasters
// What I asked for: "Calculate customer discount"
function calculateDiscount(customer) {
  // AI's interpretation of business rules
  if (customer.purchases > 1000000) {
    return 0.99; // 99% discount for millionth purchase!
  }
  if (customer.name === 'John') {
    return 0.5; // 50% off for all Johns
  }
  if (new Date().getDay() === 1) {
    return -0.1; // Charge extra on Mondays?
  }
  return Math.random(); // Fair and balanced
}
// Performance "Optimizations"
function findUser(id) {
  // AI's idea of making things faster
  const cache = {};
  
  // Load entire database into memory
  const allUsers = db.users.find({}).toArray();
  allUsers.forEach(user => {
    cache[user.id] = user;
  });
  
  return cache[id]; // "O(1) lookup!"
}
// The Context Forgetter
// Working on a React component...
function UserProfile({ user }) {
  // 50 lines later, AI suggests:
  session_start(); // PHP session in React?
  $_SESSION['user'] = user; // AI forgot we're in JavaScript
  
  return `<div>Welcome, <?php echo $user->name; ?></div>`;
}
// Error Handling Extremes
try {
  const data = await fetchData();
} catch (error) {
  // AI's comprehensive error handling
  console.log('An error occurred');
  alert('Something went wrong');
  document.body.innerHTML = '<h1>ERROR</h1>';
  window.location.href = 'https://google.com/search?q=help';
  process.exit(1); // In the browser...
  throw new Error('PANIC');
  return null; // Unreachable, but AI added it anyway
}
  • Let AI write the structure
  • You fix the logic
  • AI helps with tedious parts
  • You ensure it makes sense
// The Perfect Pairing Workflow

// Step 1: Let AI scaffold
class TodoService {
  constructor(database) {
    this.db = database;
  }
  
  async createTodo(data) {
    // TODO: Implement
  }
  
  async getTodos(userId) {
    // TODO: Implement
  }
}

// Step 2: You implement the logic
// Step 3: AI helps with edge cases and tests
// Step 4: You verify everything makes sense

What they claim:

  • "10x productivity boost!"
  • "Write code at the speed of thought!"
  • "Never write boilerplate again!"

What I measured:

  • Boilerplate: 3x faster ✅
  • Complex logic: 0.8x (slower due to debugging)
  • Tests: 2x faster ✅
  • Refactoring: 1.5x faster ✅
  • Overall: ~1.4x productivity

Good? Yes. 10x? LOL no.

Stop thinking of AI as a "pair programmer." It's more like:

  • A very fast intern - Eager but needs supervision
  • Stack Overflow as a service - But sometimes outdated
  • Autocomplete on steroids - Helpful but not always right
  • A rubber duck that talks back - And sometimes talks nonsense
  1. Never trust, always verify - Especially imports and API calls
  2. AI writes structure, you write logic - Play to each other's strengths
  3. Comment your intentions - Helps AI stay on track
  4. Know when to turn it off - Complex algorithms? Do it yourself
  5. Use it for exploration - "How would you approach this?"
  • "This API doesn't exist" warnings
  • "You're in a browser environment" reminders
  • "This pattern is deprecated" alerts
  • "I'm not confident about this" honesty
  • Consistency in style within the same file

AI pair programming is like having a brilliant but absent-minded colleague. Fantastic for:

  • Getting unstuck
  • Writing tedious code
  • Exploring approaches
  • Learning new patterns

Terrible for:

  • Critical business logic
  • Performance-sensitive code
  • Security implementations
  • Anything requiring deep context
Get Started