Coffee and Code

I’m eschewing the pursuit of useful information this week to instead bring you this frivolous post on coffee… enjoy.

Coffee, like cooking and baking, seems to be synonymous with being a game developer (Why do game developers like cooking and baking so much?). I’m sure some game devs out there don’t actually enjoy coffee (purely for the purpose of disproving my theory). So, for those of you that fall into that camp… sorry. Keep enjoying your tea, water, or whatever (maybe someone can write a herbal tea guide). For the rest of you, here’s my guide to coffee for game devs.

Coffee is very much a personal thing and you should create a process that works for you and produces coffee that you like. This is my process.

1) Break for coffee

Usually, after about an hour or two of game development, I’m ready for a coffee break. Equally, if I’m stuck on a particular problem and struggling with the solution, I break immediately for coffee. It’s important to take a break from coding if you feel this happening. You’re unlikely to get the solution whilst sitting at your screen, and time spent making a coffee (15 minutes or so if you follow this guide) is just right for that magical solution to pop into your head. You could of course spend the time having a break without coffee but really, what’s the point? Coffee tastes great and fixes your code. What’s not to like?

2) The espresso machine

Espresso is the basis for a good Americano (my drink a choice) which consists of a single shot of espresso (the cups I use are quite small) topped up with hot water.

There are hundreds of espresso machines on the market and I’m not knowledgable enough to advise you on what to get. I currently have a Dualit Espressivo which does the job and was fairly inexpensive. I’m currently lusting after a Gaggia Achille. If you want to go cheap then get something like the AeroPress – Apparently they’re quite good and I’m interested in getting one myself.

Fill your espresso machine’s water reservoir with fresh water and turn it on now. It takes time for the machine to get up to temperature and in the case of the Espressivo I find that its better to leave it for longer than the user manual suggests.

3) Choosing your coffee

Choosing the right coffee is an important decision. It’s also completely down to your own taste. I like bold coffees with powerful flavours but you may prefer something lighter. I’m currently drinking Brazil Fazenda Cachoeira da Grama Bourbon. If you’re in the UK, Has Bean is a great place to purchase your coffee, with superb information on each coffee and a passionate coffee roaster (Perhaps those of you in other countries can suggest good places to buy your beans in the comments below).

Whichever beans you choose, once opened, they are best stored in an air-tight container, in a cool (not the fridge), dark place. Bags with one-way valves work well too.

4) Grinding the beans

The advantage of grinding your own coffee is freshness and flavour. It really does produce a superior cup. You need a good burr grinder for grinding your coffee beans. Electric burr grinders can be very expensive so I’ve adopted a slightly left-of-the-middle option and use a vintage Zassenhaus hand coffee grinder. These things are great. They’re a fraction of the price of an electric grinder and really get you closer to the experience of making coffee. You should be aware that grinding by hand requires a little more time and effort, and hand grinders also have limited bean capacity (enough for a single cup).

I find that hand grinding the beans gives me a perfect opportunity to mull over my code in my head. I’m convinced that the smell of coffee wafting up aids in thinking up some truly creative solutions.

Lazy option: Sometimes you won’t want to grind a fresh batch of beans and in these instances I have a tin of illy’s ground coffee waiting in the wings.

5) Flush the machine

Its important to flush water through the machine before you extract your espresso. Just place the empty basket in the portafilter, a cup underneath, and turn the machine on. This also serves to warm your cup. Wipe the basket and portafilter dry once you’ve done this.

6) Tamping

The next step is to transfer the ground coffee from your hand grinder to the portafilter basket. I tend to use a teaspoon for this because it helps me to distribute the coffee evenly in the basket. Get your tamper and apply a decent amount of pressure to compact the coffee. Everyone has a slightly different technique for this. The method I use is to lightly tamp to compress the coffee, then apply a good amount of pressure, and finish with a quarter twist of the tamper to seal the puck.

I find that around about now, the solution for my code problem pops into my head. Often its something simple, these things always are. Don’t rush off to fix it yet though, finish the coffee first.

7) Extraction

Okay, the extraction process. I’ll try to give you some basic guidelines on what works for me but trust your taste and don’t worry about getting it wrong.

I use a coffee shot glass, marked at 1oz, to help me with this step. You’re aiming for 1oz of espresso in about 25 seconds. I prefer to slightly under extract the espresso and retain some of the sour edge.

If your coffee tastes bitter then it is probably over extracted. That is to say, the extraction process took longer than 25 seconds to obtain a 1oz shot.

If your coffee tastes sour then its is most likely under extracted. This means the extraction process was faster than 25 seconds.

Remember, the constant is the 1oz shot. In order to compensate for under or over extraction, you’ll need to alter your ground to make it either finer (if you’re coffee is under extracted) or coarser (if you’re coffee is over extracted).

8) Finishing touches

Transfer the espresso to a cup and top it up with hot water (just off the boil). You can then add your desired finishing touches. I tend to just add a splash of whole milk.

9) Spillages

So you’ve got your awesome coffee and you’ve brought it back to your desk only to be confronted by your screen, a keyboard and mouse, 2 iPad’s and 13 iPhones trailing from the computer, and your graphics tablet taking up most of the room. You have few options here, you could use an iPhone as a coaster (There’s an App in that somewhere, especially if it farts too), you could use my preferred method of shoving the graphics tablet out of the way whilst simultaneously scratching your iPad on your laptop, or you could prepare some space beforehand (or you could have if I had mentioned this as step 1).

In the unlikely event that you spill your coffee all over your computer, don’t worry, just close your eyes and imagine it didn’t happen. When you open them again, the spillage will be miraculously cleaned up.

So there you have it. Hopefully during the process of making coffee, and truly enjoying doing so, the solution to your coding problem popped into your head and you can continue writing your epic game. Good coffee has once again saved the day.

This post is part of iDevBlogADay, a group of indie iPhone development blogs featuring two posts per day. You can keep up with iDevBlogADay through the website, RSS feed, or Twitter.


  1. I’ve seen the correlation between game developers and cooking mentioned a few times recently.

    My theory on this is that both fields come down to finding the right formula to create the perfect result. The right ingredients in the right amount used at the right time at the right temperature can be the difference between a culinary masterpiece and a flop.

    It is no exact science (although knowing the chemistry behind each component can help) and experimentation can produce wondrous results you may never have thought of.

    In games, your end result is usually the difficult-to-describe Fun. There’s no formula and the exact placement and tweaking of dozens of variables come together to achieve this complex goal.

    In both cooking and games, you are continually striving to get the perfect result, whether taste or fun, and you can endlessly iterate upon your previous creations. For those of a geek nature, the ability to tweak and tune seems to be too much to resist.

    (PS. I own an Aeropress and it is surprisingly good. It’s easy to clean and fast. The seal can become slightly worn over time however.)

  2. This post actually made my day Chris! Thanks for sharing those tips in coffee making! Although I have to add that devs should drink coffee moderately–I got my gastritis from it. :)

  3. A man after my own heart! I utilise coffee breaks in exactly the same way, although I haven’t moved on to espresso machines yet. My cafetiere does a good job, although since I’ve been grinding myself it’s tasted a little bland. Maybe I’m not getting the grind size right. Any advice?

  4. Chris says:

    @Jey – I’ve never thought about the tweaking and tuning before. I suppose that is one of the reasons I enjoy cooking and baking.

    Good to hear some first hand experience of the Aeropress, I’m definitely intrigued enough to give it a go.

    @Erick – Thanks, glad you enjoyed the post. Sorry to hear about the gastritis but a good tip all the same.

    @Luke – Yes, I believe we’ve had a few coffee related conversations on twitter.

    Regarding the cafetiere – make sure you’re beans are fresh and grind them just before use. I usually produce a grind with a consistency similar to fine sand but it should certainly be coarser than that used for Espresso.

    Warm the cafetiere with some hot water before you use it.

    The rest is just the same basic steps you know – 1 tablespoon of coffee per cup and a brew time of around 4 minutes.

    Personally I find cafetiere coffee a little weak and insipid anyway – Maybe you should consider the Aeropress, especially if you’re going to the trouble of grinding your own bean already.

  5. david says:

    hi what´s the perfect tamper size for the dualit, i have one but i need mi own tamper, whats your tamper size?

  6. Chris says:

    I have a 48mm aluminium tamper. It works ok with the dualit but to be honest it’s a little bit small. Id be tempted to go 50mm.

    Anything is an improvement over the tiny plastic one included :)

  7. david says:

    lot of thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.