Sitemap
CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Member-only story

Debugging Code vs. Debugging Yourself

--

Press enter or click to view image in full size

What four years of chasing bugs in a government forms system taught me about chasing what’s actually wrong with me

A few weeks back, I spent close to three hours hunting a bug that made zero sense.

A dropdown — just a simple “Police Station” field — kept showing “Other” even when the user had picked a proper value from the list. Not always. Just sometimes. Which is the worst kind of bug, honestly. The ones that happen sometimes are the ones that break you slowly.

I did what I always do. Opened the console. Started logging. console.log('value before render:', value). console.log('value after API response:', value). Narrowed it down field by field, state by state, re-render by re-render, until I found it — a stale closure holding onto an old value from a previous form load. Fixed in one line, once I actually found the line.

And somewhere around the second hour of staring at logs that made no sense, it hit me — this is exactly what I do (or don’t do) when I’m stuck in my own head. Except with myself, I never open the console.

We don’t debug ourselves. We just re-render and hope.

--

--

Mayank
Mayank

Written by Mayank

Software developer by day. Writing about what actually happens when developers use AI tools on real project. Honest takes from someone who codes for a living.

CodeX
CodeX

Published in CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers