Search This Blog
HexRoast is a craft coffee brand and journal built by a small team of developers and designers who got tired of drinking bad coffee while shipping good software. https://hexroast.com
Featured
- Get link
- X
- Other Apps
When Developers Should Actually Drink Coffee: A Daily Timeline
Caffeine has a half-life. Most developers don't think about it. The right answer to "when should I drink coffee" depends entirely on when you need to be alert and when you need to sleep.
I used to drink coffee whenever I felt tired. This is, it turns out, exactly backwards. Caffeine doesn't work the way most people think it does, and "drinking it when tired" leads predictably to bad sleep, which leads to more tiredness, which leads to more coffee. Eventually you're at four cups a day and not sure why.
What follows is the timing protocol I've been on for about a year. It's based on a couple of well-known facts about caffeine, applied to a developer's actual workday. It's not magic, but it works.
Three things you need to know about caffeine
1. The half-life is about 5-6 hours. If you drink a cup at 2pm with 80mg of caffeine, at 8pm you still have ~40mg in your system. At 2am you still have ~10mg. That last 10mg is enough to disrupt sleep for sensitive people.
2. Cortisol peaks in the morning, around 8am. Cortisol is your body's natural alertness chemical. Drinking coffee while cortisol is already peaking is partially wasted — the coffee is competing with your body's own alertness signal. The caffeine has more effect when cortisol is naturally lower.
3. Tolerance builds in about 7-10 days. If you drink the same dose of caffeine at the same time every day for a week, you stop feeling the alerting effect. Your body adapts. The coffee is now mostly serving the function of preventing withdrawal headaches.
The timing protocol
9:30-10:30am — first cup
Not first thing. Not at 7am. The window where caffeine has the most marginal effect is after your morning cortisol has peaked and started to drop. For most people who wake up at 7am, that's around 9:30-10:30am.
If you wake up needing coffee immediately, you're probably caffeine-dependent. The first cup of the day is the one most worth optimizing — moving it later by an hour makes a noticeable difference in how alert you feel by midday.
12:30-1:30pm — possible second cup
The afternoon dip is real. Most developers feel it around 2pm. A small cup or shot ~90 minutes before the dip prevents the worst of it without producing the late-day caffeine spike.
This second cup is optional. If you slept well the night before, skip it. If you slept poorly, drink it but make it smaller than your first cup. A short Aeropress or a single espresso, not another full mug.
After 2pm — nothing
This is the rule that took me longest to accept. The math: caffeine consumed at 2pm still has half its dose active at 8pm and a quarter at midnight. Even if you "fall asleep fine," your sleep quality is reduced. You'll feel slightly tired tomorrow. You'll want more coffee tomorrow.
If you're one of the 20% of people with a fast caffeine metabolism (this is genetic), you can get away with a 2pm cup. Most of us cannot. The cleanest test: skip all caffeine after noon for two weeks and see whether your sleep changes. If yes, you're not in the fast-metabolism group.
3-4pm — the coffee nap
Counterintuitive, but well-supported by research: drink a small espresso, then immediately lie down for a 20-minute nap. The caffeine takes about 20 minutes to start working. By the time you wake up, the caffeine is hitting and you've also had a brief sleep cycle. The combined effect of nap + caffeine is more alerting than either alone.
This works especially well around 3-4pm if you're trying to push through to evening. The 20-minute cap is important — longer naps will make you groggy.
Evening — decaf or nothing
If you do most of your work in the evening (some developers do), one cup of decaf around 7pm gives you the ritual and the warmth without the sleep disruption. Modern decaf is much closer to regular coffee than people remember; if you haven't tried it in five years, try it again.
What this looks like in practice
Wake at 7. Water and breakfast. First cup at 9:45 — not from a need, but as the start of the workday. Deep work block from 10 to 12:30. Lunch and a short walk. Second cup at 1pm if needed. Afternoon work block. Coffee nap at 3:30 if I'm flagging. End of day around 6.
Total caffeine: 1-2 cups. Sleep quality consistently good. Tolerance hasn't built up because I vary the dose day-to-day depending on actual need.
The thing nobody tells you when you start drinking coffee for productivity: less is usually better, and timing matters more than dosage. A single cup at the right hour does more for you than three cups distributed badly.
Midnight coding rituals — the deep version
This was the daytime version. If you want the late-night version — twenty indie hackers on what they actually drink at 1am, the rituals that work, and the ones that look romantic but burn you out — that lives on HexRoast:
→ Midnight Coding Rituals · hexroast.comSubscribe to the roastlog newsletter → hexroast.com/#waitlist
- Get link
- X
- Other Apps
Popular Posts
First Time Buying Ethiopian Beans: 3 Mistakes I Made
- Get link
- X
- Other Apps
Water is 98% of Your Coffee. You're Probably Getting It Wrong.
- Get link
- X
- Other Apps
Comments
Post a Comment