Brewing coffee is tuning a four-variable system
Grind, ratio, temperature and time. The right way to dial in a coffee is the same as debugging a system: change one thing at a time
For a lot of people who write code, the first coffee of the day is almost a ritual. Before opening the editor, before looking at messages, there's the water heating up, the smell of the grounds and a few minutes without a screen.
And the more I learn about it, the more I realise that making coffee has a lot more to do with programming than it seems. Not because of the fuel, although that helps. But because getting a cup right is, quite literally, tuning a system with several variables.
Grab your mug and I'll explain.
What extraction is
Making coffee means using water to pull out of the grounds the compounds that give flavour, aroma and body. That's extraction.
The point is that not everything comes out at once. The first compounds to come out are the acidic, fruity ones. Then the sweet ones. Last, the bitter and astringent ones. A good coffee is one where extraction stops at the right point: it pulled out enough to be sweet and balanced, but not so much that it drags the bitterness along.
water meets the grounds to full extraction. Under-extracted, from 0% to 38%: Sour, thin, no sweetness: Grind a little finer. Just right, from 38% to 66%: Sweet, balanced: Change nothing. Write the recipe down. Over-extracted, from 66% to 100%: Bitter, dry, harsh: Grind a little coarser. Acids and fruit, from 0% to 42%. Sweetness, from 24% to 74%. Bitterness and astringency, from 58% to 100%.
- In the cup
- Sour, thin, no sweetness
- Diagnosis
- Under-extracted
- Next adjustment
- Grind a little finer
- In the cup
- Sweet, balanced
- Diagnosis
- Just right
- Next adjustment
- Change nothing. Write the recipe down
- In the cup
- Bitter, dry, harsh
- Diagnosis
- Over-extracted
- Next adjustment
- Grind a little coarser
The four variables
| Variable | What it controls | To extract more |
|---|---|---|
| Grind | How much of the bean the water reaches | Grind finer |
| Ratio | How much coffee for how much water | Use less water for the same grounds |
| Temperature | How fast extraction happens | Use hotter water |
| Time | How long the water touches the grounds | Leave it longer |
There are others, like water quality and the roast. But these four are the ones you control every day, in your kitchen.
As a reference for filter methods, many people start with something close to 1 gram of coffee for every 15 to 18 grams of water, and water between 90 and 96 degrees Celsius. They're starting points, not rules. Your beans and your taste decide the rest.
The beginner's mistake
This is where it turns into programming.
The coffee came out bitter. What do a lot of people do? Grind coarser, use less coffee, let the water cool a little and pour faster. All at once.
The next coffee comes out sour. Now what? Which of the four changes went too far? There's no way to know.
You've seen this film at work. The system is slow, and someone changes the database configuration, adds a cache, bumps the server's memory and rewrites a query in the same deploy. It got faster, or slower, and nobody knows which change was responsible.
Change one variable at a time. It's slower at first and much faster in the end.
Measure instead of guessing
The second lesson is to measure. "A heaped spoonful" and "water that's nearly boiling" aren't reproducible. A kitchen scale and a timer turn coffee into an experiment you can repeat.
And then the same applies as with a system: if you don't measure, you don't know whether it got better. If you don't write it down, you won't remember what you did the last time it was good.
A little notebook helps a lot
Writing down the beans, grind, ratio, temperature, time and a tasting note seems over the top. After a week, you have a history that shows the way. It's basically a log, just for coffee.
The tuning map
If you want to start dialling in your coffee, a simple strategy:
- Fix the ratio and the temperature.
- Change only the grind until the coffee comes out balanced.
- If it's sour, grind a little finer. If it's bitter, a little coarser.
- Once it's good, then try changing the ratio to adjust the strength.
It's the same idea as good debugging: isolate, change one thing, observe, write it down. Repeat.
What to take away
- Brewing coffee means pulling compounds out of the grounds, and they come out in order: acidic, sweet, bitter.
- Sour usually means under-extraction; bitter, over-extraction.
- The four everyday variables are grind, ratio, temperature and time.
- Change one at a time, measure and write it down. In coffee and in code.
Next time your coffee comes out bitter, resist the urge to change everything. Change the grind. Only the grind. And taste it again.