Complex systems
The whole animal: what I learned about debugging in a hospital
A biologist turned developer spends a year as a patient and finds that the working part of medicine is the thing he does at two in the morning when a shop is losing orders.
In the summer of 2025 I had surgery to remove a cancer. I was terrified, and I came out of it a different person, but that is a story for another day. It is here because it put me in a lot of rooms with a lot of doctors, and I noticed something I had not expected.
When a doctor starts explaining something, I usually tell them I studied biology. It is meant to be helpful. They can skip the version with the simple words and use the real terms, and I will mostly follow. It works, in the sense that the explanations do get more detailed.
But every single time, the reaction is the same. Oh, biology, I liked that at school. Said warmly, the way you might say it to someone who mentioned they once built websites in Flash.
I found that odd. I had always thought of medicine as a branch of biology. Applied, obviously, and with a lot more paperwork, but the same subject. The doctors clearly did not see it that way. To them biology was something they had passed through on the way to becoming something else.
Two biologies
When a doctor says biology, they mean what they did before medicine. Cells, biochemistry, the pathways from gene to protein, the machinery. It is a foundation course. You learn how the parts work, and then you move on to the much harder business of what to do when the parts go wrong in a person. Seen from there, biology is something you complete.
The biology I studied ended up being ecology, and I should be careful here, because we learned the machinery too. Biochemistry, chemistry, microbiology, a lot of small disciplines each looking closely at one thing. That was not skipped.
What was different was where it all sat. None of it was the destination. Each of those subjects was a way of finding out something specific, an approximation that contributed to understanding how an organism functions. But the real picture was always the organism in its environment, and it was taken as obvious that you only get that by studying it there. The parts were instruments. The animal, in the place it actually lives, was the subject.
So the core lesson was that you cannot understand the thing by taking it apart, because the interesting behaviour only exists when everything is running at once, in a setting that pushes back. You get comfortable with variation and uncertainty very early, or you switch subjects.
There was something else, which I could not have articulated at the time. Every one of those subjects was taught in isolation, and I kept feeling that the links between them were the interesting part and nobody was talking about them. Biochemistry over here, microbiology over there, ecology somewhere else. It seemed obvious to me that the behaviour we were trying to explain lived in the connections rather than in any one of the boxes, and that the boxes were an artefact of how you teach a thing, not how the thing is.
I have exactly the same feeling about software, and it took me far too long to notice it was the same feeling. A running system is not just code and how fast it performs. It is the components talking to each other, the language, the stack it sits on, the hardware underneath, and the users, who are not outside the system at all. They are part of the environment it lives in, and they push back on it constantly. Cells and biochemistry and organs on one side; components and languages and machines on the other; and in both cases an environment that will not hold still.
I carried that around for nearly thirty years without a name for it. Then I heard Denis Noble on a podcast, saying it out loud. Noble is a physiologist who has spent decades arguing against what he calls the dogma of biology: the idea that causation runs one way, up from the genes, and everything above that is just consequence. There is no privileged level, he says. Genes shape the organism, and the organism shapes which genes get used.
I kept stopping the podcast to think, but I was never taught it any other way. What he gave me was not a new idea. It was permission to take an old one seriously, and to notice I had been applying it all day at work without ever calling it biology.
So when I tell a doctor I studied biology, I am telling them I studied the whole animal. And they are hearing that I studied the parts, which they finished with years ago and rather enjoyed.
Which is ironic, because what the doctors actually do all day is the biology I learned, not the one they did.
What a clinic actually does
The biochemistry is settled by the time a patient arrives. Nobody in the consulting room is investigating how a cell works. They are looking at one particular person, with a history, a set of results that do not quite agree with each other, and a life outside the building that will affect whether any treatment actually happens. The question is never what is true in general. It is what should we do for this one, now, with what we know, and there is a queue outside the door.
That is not a science in the strict sense. A science asks what is true. Medicine asks what to do. Engineering has the same relationship to physics, and nobody thinks less of bridges for it. But it does mean that the working part of medicine, the part that happens in the room, is whole-organism thinking under uncertainty. Feedback, variation, the individual embedded in a context. Ecology, in other words, practised on one animal at a time.
You can see this in how a hospital is organised. In Austria there is a clear ladder, from the trainees through the assistant doctors and senior doctors up to the head of department. I had assumed it was seniority, the way any workplace has seniority. It is more than that. It is about who is allowed to carry risk. The junior doctors take the history and do the routine work, but a decision that commits the hospital to something has to travel up the ladder to someone who has seen enough to sign for it.
One of the doctors I see at every checkup remembers that I studied biology, and asks about it. He is warm, and straightforwardly human with me, and I do not think that is a decoration on top of the medicine. It is part of how the thing works. You tell a doctor more when you are not performing being a good patient at them.
In my case the head of department explained the operation and then did the operation. At the time I thought that was a courtesy. I now think it is the whole principle. The person who decides is the person who carries it, because when something unexpected turns up with the patient open on the table, someone has to decide what to do in the next thirty seconds without asking anyone.
There were two operations. Going into the first, I was still awake enough to count the people in the room, and there were about ten of them. I later worked out that most of them were not there to operate. They were there to watch, because you cannot learn to recognise a surprise from a textbook. You have to have stood in the room when one happened.
I had seen this pattern before. Not in a hospital. In a server room.
The same animal
I have built websites since 1995 and shops since 1999, and for most of that time I have thought of the work as applied logic. You read the code and you know what it does. On your own machine, that is even true. Everything is inspectable and repeatable. If it breaks, you break it again and look.
Production is a different animal, and I mean that literally. Once real users arrive, with real timing and real load and the thousand small things nobody predicted, the system starts behaving in ways you cannot derive from the code. Two identical requests take different paths. A failure happens once at three in the morning and never again. Reading the source is the machinery view. Running it in front of the public is the whole organism.
Anyone who has worked on a live system knows the specific kind of failure I mean. It only happens under real traffic. You cannot reproduce it locally, so you cannot step through it and watch it go wrong. You have logs that tell you it happened and not why. And what you actually do, at two in the morning with the shop losing orders, is change the thing most likely to be responsible and then watch to see whether the behaviour stops.
That is not debugging in the way I was taught the word. You are not identifying a cause and removing it. You are treating a system whose diagnosis you do not have yet, using the most plausible intervention available, and using the response to tell you whether you were right. Most of the time it works. Some of the time it works and you never find out why, which is worse, because you have lost the chance to learn the shape of it.
Medicine has a name for this. Empirical treatment, or a trial of therapy. You start antibiotics before the culture comes back, because waiting three days for certainty costs the patient more than acting on the most likely answer now. If they improve, that tells you something about what it was. The response becomes part of the diagnosis.
It is not how doctors work most of the time, and I would not want to suggest it is. It is one recognised mode among several, reserved for when the cost of waiting is higher than the cost of being wrong. But it is taught, it is deliberate, and it has been thought about carefully for a long time.
Which is more than I can say for what I do at two in the morning. I did not realise until I was sitting in a consulting room that I had been doing a worse-documented version of the same thing.
My ecology training had, without my noticing, prepared me for this long before I understood it. An organism is not a biochemical pathway. It is not even a single cell, which is unpredictable enough. It is a multicellular thing made of semi-independent organs, and then that whole arrangement is repeated across a population, none of whom are quite the same. When you have spent years thinking that way, the messiness of a live system does not feel like a defect. It feels like the normal condition of anything that is actually running.
This is Noble’s point, arriving somewhere he was not talking about. There is no privileged level. You cannot read the code and know the system, any more than you can read the genome and know the animal. The behaviour lives in the whole thing running at once, and the whole thing is never quite the same twice.
So the surprise for me was never that medicine is uncertain, or that software in the wild is uncertain. Of course they are. The surprise was finding out that the people who live inside that uncertainty every day, and handle it well, think of it as a different thing from the biology that taught me to expect it.
Which raises the question I actually care about. If the knowledge is the same, what is it that the senior surgeon has that the junior one doesn’t? It isn’t in any textbook.
What experience actually is
The honest answer is a library. Not of facts, which the junior doctor may well have more of, fresher and better organised. A library of shapes. This is what a bleed looks like when it is going to stop on its own, and this is what it looks like when it is not. This is the kind of slowness that means a server is busy, and this is the kind that means something has quietly gone wrong underneath.
There is a word people in my field use loosely, and I will use it carefully. A programmer is someone who can make a computer do a thing. A developer, in the sense I mean, is someone who has watched enough things go wrong in front of real users to recognise the next one a little before it announces itself. The difference is not intelligence and it is not knowledge. It is exposure, accumulated slowly and usually at some cost.
That is the same thing seniority buys in a hospital. Not better hands, necessarily. Enough variations seen that the surprise is not actually a surprise. And it explains the ten people in the theatre, and the ladder of who gets to decide, and why the head of department did my operation himself. You cannot shortcut it. You cannot read your way to it. You have to have been in the room.
It also explains, I think, why an ecologist walks into a hospital and feels oddly at home. The stakes are wildly different. A failed deployment is not a failed operation and I am not going to pretend otherwise. But the shape of the work is the same. A system you cannot fully see, misbehaving in ways the parts do not explain, and one person in the room who has seen it before.
The doctor was right, in a way. I did like biology at school. I just never stopped doing it.