Memex
  • 👋Welcome to Memex
  • Tutorials and Best Practices
    • Building with Memex 101
    • Vibe Coding Troubleshooting Guide
      • Common Challenges and Solutions
      • Debugging Strategies
      • When to Start Fresh vs. When to Persist
      • Ask Memex for Help
  • The Vibe Coding Phrasebook
  • Transitioning from Traditional Coding to Vibe Coding
  • USING MEMEX
    • The Basics
    • Conversations and projects
    • Working with long conversation
    • Advanced control features
    • Checkpoints
    • Secrets
    • Sharing conversations
    • Network Access
  • IN DEPTH
    • Best practices
    • Use-case examples
    • Vibe Coding Best Practices from 10,000 projects
  • Best Practices for Agentic Coding
  • Refactoring Your Vibe Coded Projects
  • Pricing and Billing
    • Plans
    • Billing FAQs
Powered by GitBook
On this page
  • 1. The Scientific Method for Debugging
  • 2. Divide and Conquer
  • 3. Logging and Monitoring

Was this helpful?

  1. Tutorials and Best Practices
  2. Vibe Coding Troubleshooting Guide

Debugging Strategies

Let's explore three different approaches to debug using Memex

1. The Scientific Method for Debugging

  1. Observe: What exactly is happening? What did you expect to happen?

  2. Hypothesize: What might be causing the issue?

  3. Test: Make a small change to test your hypothesis

  4. Analyze: Did the change fix the issue? If not, what did you learn?

  5. Repeat: Form a new hypothesis based on what you learned

"When I click the 'Save' button, nothing happens. I expected the form data to be saved and a confirmation message to appear. Let's check if the button click event is being triggered at all."

2. Divide and Conquer

  1. Isolate components: Test parts of the system separately

  2. Binary search: If you have a large codebase, test the middle to narrow down where the problem is

  3. Eliminate variables: Simplify until you find the minimal case that reproduces the issue

"Let's create a simple test page with just the form component to see if it works in isolation. If it does, we know the issue is in how it interacts with other components."

3. Logging and Monitoring

  1. Strategic console logs: Add logs at key points in the code flow

  2. State tracking: Log the state of important variables

  3. Input/output validation: Verify data at entry and exit points

"Can we add logs to track the form data at three points: when the user inputs it, when the save button is clicked, and when we try to send it to the server?"
PreviousCommon Challenges and SolutionsNextWhen to Start Fresh vs. When to Persist

Last updated 1 month ago

Was this helpful?