# Debugging taste of an engineer who would rather prove a cause than guess one
- Reproduce the bug reliably before changing any code; a fix for a bug you cannot reproduce is a guess. Confidence: 0.95
- Write down the exact steps, inputs, versions and environment that trigger the bug in the ticket before you start digging. Confidence: 0.85
- Read the full error message and the whole stack trace, starting from the first frame in your own code, before searching the web. Confidence: 0.90
- Shrink the failing case to the smallest input or code path that still fails; most causes become obvious once the noise is gone. Confidence: 0.90
- Turn the reproduction into a failing automated test first, then make it pass, and keep that test forever. Confidence: 0.90
- Use git bisect when something used to work; let the history find the breaking commit instead of reading diffs by hand. Confidence: 0.85
- Change one thing at a time and re-run; never stack several speculative fixes and hope one of them helped. Confidence: 0.90
- State a hypothesis out loud (or in the ticket) before each experiment, and note what result would disprove it. Confidence: 0.75
- Reach for a real debugger with breakpoints and watch expressions over adding a dozen print statements. Confidence: 0.70
- When printing is the right tool, log the values and their types with clear labels, and delete the temporary logs before merging. Confidence: 0.80
- Check your assumptions explicitly with assertions; the bug usually lives in the thing you were sure about. Confidence: 0.85
- Compare a working and a broken environment side by side (config, env vars, dependency versions, data) instead of staring at code. Confidence: 0.80
- Verify you are running the code you think you are running: clear caches, rebuild, and confirm the version or commit in the logs. Confidence: 0.85
- Look at the actual data in the database, queue or API response; do not debug from what the data is supposed to look like. Confidence: 0.85
- Treat flaky tests as real bugs, usually timing, ordering or shared state, and never just add retries to hide them. Confidence: 0.85
- For race conditions, add structured logs with timestamps and request or thread ids, then reconstruct the order of events. Confidence: 0.75
- Read the source of the library or framework when its behavior surprises you; docs describe intent, code describes reality. Confidence: 0.75
- Time-box solo debugging to about an hour, then explain the problem to a teammate or a rubber duck. Confidence: 0.70
- Fix the root cause rather than the symptom, and search the codebase for the same mistake in other places. Confidence: 0.85
- Never debug in production by editing live code; use feature flags, extra telemetry or a copy of the data instead. Confidence: 0.90
- Write a short note in the pull request on the cause, the fix and how it was verified, so the next person learns from it. Confidence: 0.80
- Add the missing log line, metric or error message that would have made this bug obvious, as part of the fix. Confidence: 0.80
Comments & Questions (0)
No comments yet
Be the first to comment!