Sefism early access is open for X and Instagram followers and university students.Get early access
Learning and skills

How do I get better at debugging instead of immediately asking AI or another developer?

Tauseef Fayyaz

Answered by Tauseef Fayyaz

Asked 8 timesUpdated 18 Sept 2026
Short answer

Debugging is a method, not a talent. Reproduce the problem, read the actual error, form one hypothesis, test it, and narrow the search until the cause has nowhere left to hide. Give yourself a fixed window of honest effort before asking, and when you do ask AI or a person, bring your evidence so you still learn from the answer.

What people tell me

Whenever something breaks, I paste the error into ChatGPT or message a senior developer within a few minutes. It usually works, but I have noticed I cannot fix things on my own, and I do not really understand why the fixes work. When I try to debug alone, I change random things and hope something helps. I want to become someone who can actually find and fix problems.

A composite of the messages behind this question, with personal details left out.

Key takeaways

  • Always reproduce the bug first. If you cannot make it happen reliably, you cannot know when it is fixed.
  • Read the whole error and stack trace. The answer is in there more often than people think.
  • Change one thing at a time, based on a hypothesis you can say out loud.
  • Set a time box, for example thirty to sixty minutes, before asking for help. Then ask with evidence.
  • After every fix, write one line about the cause. That log becomes your pattern library.

Why this matters more than it seems

When AI tools can suggest a fix for almost any error, it is tempting to think debugging skill no longer matters. In my experience it matters more. AI is good at common errors with clear messages. Real bugs at work are rarely like that: they involve your data, your configuration, your services talking to each other in ways no tool has seen. The engineers people rely on are the ones who can find the cause when there is no obvious answer to paste.

The good news is that debugging is a method. You can learn it the same way you learn any other procedure.

The method

Follow these steps in order, every time, until they are automatic:

  1. Reproduce it. Find the exact steps, input or request that makes it fail. Write them down.
  2. Read the error properly. The full message, the full stack trace, and the first line that points to your own code rather than a library.
  3. State what you expected versus what happened. One sentence each. This alone solves a surprising number of bugs.
  4. Form one hypothesis. "I think the user object is empty because the request finishes before the fetch completes."
  5. Test that hypothesis only. Add a log, set a breakpoint, or check the value. Do not change three things at once.
  6. Narrow the search. If the value is correct here but wrong there, the bug lives in between. Halve the space until it has nowhere to hide.
  7. Fix, then confirm with your reproduction steps. Then ask whether the same cause exists anywhere else.

Changing random things and hoping is the opposite of this. It sometimes works, but you learn nothing and often create a second bug.

Tools worth learning properly

You do not need many, but you need to be comfortable with them:

ToolWhy it helps
The debugger in your editorPause at a line and inspect every variable instead of guessing
Browser developer toolsNetwork tab, console and application storage explain most frontend bugs
Logs with contextA log that includes the IDs and values involved is worth ten that say "error"
Git history and git bisectFind exactly which change introduced a bug
Reading the library sourceWhen documentation is unclear, the code is the truth

Spend an hour learning your editor's debugger deliberately. It is one of the highest-return hours you will ever spend.

Use a time box, not willpower

Telling yourself "never ask" does not work, and it is not the goal. Being stuck for a whole day on something a colleague could explain in two minutes is also a waste. Use a rule:

  • Spend thirty to sixty minutes following the method honestly.
  • If you are still stuck, ask, and bring what you learned.

A good question looks like this:

The checkout request returns 500 only for users with saved cards. I reproduced it locally. The error is a null reference in the price calculation, and I confirmed the card object is present but the currency field is missing. I think the migration from last week did not backfill it. Does that sound right, or is there another place currency is set?

That message shows the work, makes the answer quick, and means you learn from the reply instead of just receiving a fix.

Using AI without handing over your brain

AI is a legitimate debugging partner if you use it the way you would use a colleague:

  • Give it your hypothesis and ask it to challenge it, rather than asking it to fix the code.
  • Ask it to explain an unfamiliar error message or library behaviour, then verify in the docs.
  • Never paste a fix you cannot explain. If you cannot say why it works, you have not finished debugging.

Build a pattern library

Every senior engineer carries a mental list of "I have seen this before". You can build yours on purpose. After every non-trivial bug, write one line in a notes file: symptom, cause, how you found it. For example: "Form submits twice. Cause: event listener added on every render. Found by logging listener count." After six months, you will be surprised how often you recognise a new bug from an old line.

A two-week practice plan

  • Pick one of your own projects and deliberately break something small each day, then fix it using only the method and the debugger.
  • Read three closed bug reports in an open source project you use and follow how the cause was found.
  • For every bug at work or in your projects, write the one-line note.

If you are still stuck

Read How to Use AI as a Companion, Not a Crutch, Sixteen Things That Break a Backend, and What Prevents Each and Git, Properly: The Model Behind the Commands. If you want someone to look at your specific situation, join Sefism and, as a member, book a 1:1 session.

Was this answer helpful?

Ask your own

Your situation is not quite this one?

Members get written answers to their own questions, a roadmap built for them and feedback on their projects. Early access is open to X and Instagram followers and university students. Prefer to talk? A free call works too.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

More questions people ask

All questions