Consciousness
What Debugging Software Taught Me About Understanding Myself
The bug is almost never where you first look. That turned out to be true of me too.
Every engineer learns the same lesson eventually. The bug is almost never where you first look.
The error shows up in one place. The cause lives somewhere else. Usually upstream, usually in something you wrote a long time ago and stopped thinking about, usually in an assumption you did not know you were making.
It took me most of my life to realize that I work the same way.
Symptoms are not causes
When software breaks, the first thing you see is a symptom. A crash. A wrong number. A page that will not load. The beginner fixes the symptom. He adds a check that hides the crash, and ships it, and the real problem keeps running underneath.
I did that with myself for years. I would have a reaction that was too big for the moment, or find myself in the same argument for the tenth time, or say yes to something I did not want to do. And I would patch it. Try harder. Be nicer. Stay busier.
The patches held for a while. The cause kept running.
Find the pattern
Good debugging is mostly pattern recognition. When does it fail? Under what conditions? What do the failures have in common? You stop looking at the individual crash and start looking at the shape of all of them together.
When I finally did that with my own life, the shape was obvious. I have a pattern of needing to have a hand in things. Even when something good happens that I clearly did not cause, part of me goes looking for the piece of it that was mine. I have to have contributed. I have never fully gotten rid of it.
And underneath that, a related one. Something is broken, I build a thing. I once responded to a struggling marriage by deciding to build an app for it. I wrote out all the questions. That is what I do.
Neither pattern is a flaw exactly. Both have served me well in my career. But once I saw them, I could see all the places they were quietly running the show.
Read the logs
Software leaves records. Logs, traces, timestamps. When something goes wrong, the answer is usually sitting there in what the system wrote down about itself while it was running.
People have logs too. They are in the body. A tight chest before a certain kind of meeting. A flash of heat when a particular person says a particular thing. A sudden tiredness when someone asks for help.
For a long time I ignored mine, the way you ignore a log file nobody has looked at in months. When I started reading them, they told me things my explanations never would.
Reproduce it safely
You cannot fix what you cannot reproduce. Engineers spend a lot of time recreating the conditions that cause a failure, carefully, so they can watch it happen.
The human version is uncomfortable. It means paying attention, on purpose, the next time the pattern starts. Not stopping it yet. Just watching it run with the logs open, so you can see the actual sequence instead of the story you tell afterward.
Fix the root, then test
The real fix is usually small. One assumption, corrected upstream, and a whole category of failures goes away.
For me the assumption was something like this: I am only worth something when I am useful. When I started to question that one line, a lot of other behavior changed on its own. Not all at once. Not perfectly. But the crashes got further apart.
And then you test. You watch for the regression. Old patterns come back under load, the same way old bugs do. That does not mean the fix failed. It means you are running in production.
The most important system
I have spent my career understanding complicated systems. The one I understood least, for the longest time, was the one running my own reactions.
It is still the most interesting system I have ever worked on. It is also the only one I cannot hand off to someone else.
This piece is part of a series called Technology & Consciousness, about where the way we build things and the way we understand ourselves meet.
