Table of Contents
1326 words
7 minutes
Programmers and Caffeine: A Hundred Ways to Drink Your Lifeblood

The most widely circulated self-deprecating joke in programmer circles is: a programmer is a machine that converts coffee into code. This interface description is clearer than any architecture document—one cup down, go to bed a little later, a few dozen more lines committed.

Jokes aside, this sentence actually mixes together three questions that can all be verified: why coffee of all things, what caffeine actually does in the human body, and how long it can hold you up. And these three questions each happen to be pretty funny.

1. The only language named after a beverage#

First, a piece of trivia: Java almost had a different name.

Its earliest name was Oak, because there was an oak tree outside James Gosling’s office window. The name was very artistic, but legal was very headache-ridden—the Oak trademark was already taken by another company. So Sun locked a dozen or so people in a conference room for a brainstorming session. According to the roundtable interview from back then, the candidate list was long enough to fill a whiteboard: Silk, Lyric, DNA, Pepper, Neon, WebRunner… In the end, Java, DNA, and Silk passed legal review.

As for who said “Java” first, even the people involved can’t remember. Frank Yellin’s exact words were “no one remembers who came up with the name first”; Arthur van Hoff thinks it was Chris Warth who said it offhand while drinking Peet’s Java coffee; Chris Warth himself says it might have been him, or might have been someone else; and Kim Polese publicly claimed “I named it.”

The most honest summary of the whole affair comes from Chris Warth: “We ended up using the name because we ran out of options and we wanted to ship the product as soon as possible.”

So strictly speaking, Java’s naming wasn’t a flash of inspiration but a deadline-driven random sampling. This also explains why it wasn’t called Lyric—that was Gosling’s own favorite name, but unfortunately it didn’t pass legal. This is probably where programmers first resonated with “the name doesn’t matter that much, shipping matters.”

Incidentally, the coffee cup logo, JavaBeans, NetBeans—a language used coffee elements all the way through, to the point that many people genuinely believe you can’t write code without drinking it.

2. Caffeine doesn’t produce wakefulness, it just borrows it#

Coffee keeps you awake not because caffeine gives you energy, but because it occupies adenosine receptors.

Adenosine is the “sleepiness deposit” that continuously accumulates in your brain during the day—the higher the concentration, the sleepier you feel. Caffeine’s molecular shape is similar enough to it that it grabs the receptors first—you can’t feel the sleepiness, but the sleepiness itself hasn’t decreased at all, it’s just queuing up. Once the caffeine is metabolized, the backlogged adenosine rushes in all at once, which is the familiar 3 PM crash.

In plain human terms: caffeine doesn’t energize you, it borrows energy from your body’s future, and the interest is calculated by the hour.

3. Dosage table: how long is 400 milligrams really#

The FDA’s reference line is: for most healthy adults, 400 milligrams per day of caffeine is generally not associated with negative effects, roughly equivalent to 2 to 3 cups of 8-ounce (237 ml) coffee.

The problem is that this number almost never appears in everyday contexts. What actually gets drunk is these (data from the common beverage table compiled by Mayo Clinic):

BeverageServingCaffeine
Brewed coffee8 oz (237 ml)about 96 mg
Espresso1 oz (30 ml)about 64 mg
Black tea8 ozabout 47 mg
Green tea8 ozabout 28 mg
Cola8 ozabout 22 mg
Energy drink8 ozabout 72 mg
Energy shot2 oz (60 ml)about 215 mg

So between “one cup a day” and “one cup a day,” there can be an order of magnitude of difference: one person’s cup is a 30-milliliter espresso, another person’s cup is a 700-milliliter iced americano—the latter is close to a full day’s quota in a single cup.

The last row especially deserves a separate look: a 2-ounce (about 60 ml) energy shot has nearly two cups of coffee’s worth of caffeine. Its selling point is “takes effect in one sip,” which translated means “one sip and you’re done.”

The FDA has also specifically warned about powdered and liquid caffeine: one teaspoon of pure caffeine powder is roughly equivalent to 28 cups of coffee, a dose high enough to cause serious health problems or even death. Turning a pick-me-up into a powder is turning “life support” into “sudden death.”

4. Half-life: that 3 PM cup is still on duty at midnight#

The data from CDC/NIOSH is: caffeine takes effect in about 30 minutes, half-life 5 to 6 hours—every 5 to 6 hours, the remaining caffeine in your body is halved.

The cruel thing about half-life is that it’s exponential decay: you’ll never encounter “just finished drinking and can sleep,” you’ll only encounter “a little bit left, just enough to keep you awake.”

Let’s calculate with code:

//CDC/NIOSH gives a half-life of 5–6 hours; here we take the midpoint
const HALF_LIFE = 5.5;
/** after drinking mg milligrams of caffeine and hours hours later, how much is left in the body */
const caffeineLeft = (mg, hours) => mg * 0.5 ** (hours / HALF_LIFE);
// One cup of 96mg coffee at 3 PM — how much is left by 11 PM?
console.log(caffeineLeft(96, 8).toFixed(1)); // 35.0
// About the same as a 12oz can of cola (the FDA range is 30–40mg)

A cup of coffee at 3 PM still leaves nearly a can of cola’s worth of caffeine in your body eight hours later. You think you’re sleeping, but you’re actually running a multithreaded background task with caffeine.

This is also why “no caffeine eight hours before bed” sounds like a wellness-account headline but actually has a clear pharmacokinetic basis.

5. A hundred ways to drink the elixir of life#

The real-world drinking list is far more exciting than the table above, and can basically be scheduled along a timeline:

  • First cup in the morning: boot self-test. If this cup isn’t finished, work hasn’t started.
  • The cup after lunch: hot patch. Not that you need a pick-me-up, but that you need a legitimate reason to leave your desk.
  • The 3 PM cup: emergency rollback. The debt from staying up late the night before comes due on the spot.
  • Espresso before deadline: force push. Doesn’t solve the problem, just refuses to accept the current state.
  • Energy drink before QA submission: temporary scaling. The CPU immediately maxes out, and the fan immediately starts roaring.
  • The evening cup of “just writing for a bit”: recursive call. It will call the next version of itself.

After drinking for a while, schools of thought form, with debates no less fierce than tabs versus spaces: the pour-over school, the cold brew school, the bulletproof coffee school, and the invisible caffeine school that claims “I only drink tea” but has four milk teas a day—milk tea often has no less caffeine than coffee, it just doesn’t look like it.

As for “Caffeine-Driven Development,” its characteristics are: iteration speed is positively correlated with heart rate, code quality follows an inverted U-shape with remaining caffeine, and technical debt happens to be written down at the very moment you’re most alert.

Conclusion#

If you take the joke apart, the conclusion is actually quite plain: caffeine regulates how you feel, not your sleep. It can make you unable to feel sleepy, but it can’t pay back the sleep debt for you.

So “no coffee after 3 PM” and “no deploys on Friday” are the same kind of rule—what’s truly dangerous isn’t caffeine, nor the day of the week, but performing an irreversible operation in the illusion of being at your best.

400 milligrams is the upper limit, not a quota; the half-life is 5 to 6 hours, not 5 to 6 minutes. As for those hundred ways of drinking it, the best one is probably to drink it tomorrow morning.

References#

Programmers and Caffeine: A Hundred Ways to Drink Your Lifeblood
https://www.hehonglei.com/posts/programmer-and-caffeine/
Author
HHLBlog
Published at
2026-10-03
License
CC BY-NC-SA 4.0