Yes, this is about programming AND coffee.
Recently I got a new obsession: Coffee. Never liked the stuff, but then I learned that I’ve been only exposed to the bad stuff and badly brewed at that… I gave a chance to the good stuff and it got me hooked. After years without touching .java
now I’m turning into a full-stack barista.
As far as coffee goes, I’m pretty sure I’m at the “peak of Mount Stupid” in the Dunning-Kruger curve. I’ve just finished learning all the basics and putting them into practice (or so I think). I still have no idea how much I don't know.
But hey, at least I'm not brewing my code like I used to brew my coffee – that is a bitter memory now.
Regardless of that, I was exposed to lots of people talking about coffee and the one common thing was:
It’s better to brew an 8/10 cup every time you want than to try a “perfect” cup and end up with a 5/10 randomly
When you start going one cup deeper, you find recipes that seem crazy to someone from the outside, they literally have recipes like “stir X times clockwise then Y times counter-clockwise during seconds W to Y after pouring the bloom water”, not to mention a heavy dependency on extreme precision in the grams of coffee and milliliters of water.
Like writing code without unit tests, brewing coffee without a scale: you might get something drinkable, but good luck reproducing it. A good brew, like good code, doesn't Java happen!"
Seems crazy to have all of that for one cup of joe (though I've heard some programmers have even crazier rituals), but when programming it would be crazy not to have all of those “rules” and “recipes” to make a new feature.
And while making it “perfect” would take a lot of effort, making it “good enough” is easier: control and record the variables, then you’ll be able to replicate and tune them to always achieve an 8/10 cup. Once you start, that appeal of always having a good one is unbeatable.
Then when we go back to programming, every day you do things differently just because and without even knowing what you’re doing differently… you question why code should be readable, and why it should look like the team guidelines. Good luck knowing what you’re doing then.
But I got a fresh bag of beans I’m not familiar with
There’s something called “cupping protocol” that has many variables fixed so that you objectively judge what that new coffee bean is about, kind of like a code review for your new coffee. By applying it repeatedly you can easily distinguish how two different beans are different from each other, just like comparing different coding languages or frameworks.
Not only that, if by each slurp (yes they slurp, loudly, it even has a reason) you try to concentrate on the acidic, sweet, bitter, or body of the coffee you can isolate each thing enough to know what you want more or less of when brewing it.
In programming, the closest thing I can think about is making a blog or TODO app, and usually focused on how fast you go from zero to complete. It usually can’t encompass everything we actually do every day or things that matter more than “how fast you can make a CRUD”.
Reproducibility and Variable Isolation: The Keys to a Good Brew (and Code)
The amazing thing about getting a new obsession is that it lets you see things you already do in a new way, with fresh eyes.
Programming should be less “grandma’s magical recipe” (full of mysterious incantations and a pinch of this, a dash of that) and more “exact instructions” (clearly defined functions and precise syntax). Conversely, with coffee, you would think that “numbers and variables” shouldn’t be involved in the brewing – who needs a debugger for their morning cup?
However, coffee snobs will dive into a discussion about each little variable like “how many microns” is the best grind for a brewing method while programmers are like: “screw it, let me just copy/paste this from the legacy codebase that accesses the database from the frontend… working… ship it“.
Brewing coffee with precision is like writing clean code: both take practice, patience, and a lot of trial and error, but you can always know exactly where you screwed up. If coffee brewing had stack traces, we'd all be able to pinpoint exactly when we poured too much water.