How coffee is like coding

Growing up in Melbourne, I've been infused with the coffee culture at a young age. I don't drink coffee to wake up or to give me an extra boost of energy, I drink it because it's part of who I am.

In 2015 I was gifted an espresso machine and was under the impression that because I knew what good coffee tasted like, I would be able to easily make one from scratch. As I presented my first two lattes to my wife and I, we reluctantly chugged down the lukewarm, bitter and weak excuse for a coffee.

It got me thinking about the relationship between making a coffee and programming. These two things that consume a majority of my life.

The Right Bean vs The Right Framework

I started off with purchasing some unknown grind off a supermarket shelf. It looked fancy and had all the right marketing collateral to persuade me that it was the right bean. The grind had little flavour and was definitely the wrong grind size for an espresso shot. I made the mistake of choosing a grind which ended up having to be chucked because it didn't play well with the kind of flavour profile I like and the machine I had.

Nowadays as developers we are inundated with amazing frameworks built by amazing people. It is so important to weigh up the pros and cons of the framework you intend to use in your build. I tend to look at a new framework with some project questions in mind. Do I need the whole framework or only a little part of it? Is there something else that lets me do what I need at a fraction of the cost (speed, complexity or need)? Is it worth using a framework at all, should I just build it using vanilla code?

Pulling the Shot vs Library Dependency

I've come to realise how important pulling a shot of espresso is. When I first started I was under the assumption that the longer I pulled the shot, the stronger the coffee would be. With a bit of experimentation, I found that so many factors come into play to how we define a great extraction. Too much extraction dilutes the flavour profiles and generally leaves a more bitter taste. Too little extraction will become bitter and not allow the coffee beans to extract the full profiles of the freshly ground beans.

Library Dependencies are a way of life in any development environment. They save development costs, usually instill best practices and allow quick and rapid development for a lean and agile product. Before I even decide on a Library Dependency, I always look at a couple of factors. How active is the library? Do the developers have a strong community of issues, versions and updates? Is there enough documentation about it? The strength and consistency of your product really does not want to sit on the reliance of other factors that are out of your control.

Steaming the Milk vs Code Complexity

Milk is so important to my coffee creations. It defines the coffee in such a strong way. It was the hardest to grasp for me, but eventually, when you get it right, it makes everything good again. Some of the key elements that got me steaming milk correctly were using the right milk (in Singapore, it's Meiji). The temperature has to be perfect. Hold your hand around your milk jug, as soon as the jug becomes too hot for your hand, stop the steam. Have the steam wand about half way into the milk before starting the steam, angle the wand to cause the milk to circle around the jug. Perfectly steamed milk should look like thick paint with minimal air bubbles. This creates a perfectly caramelised milk flavour.

Code Complexity also has an IDGE (It's damn good enough). Sometimes I find myself spending too much time refactoring my code to make it as optimised as possible. It is important to know when enough is enough and to commit and deploy. We need to always be looking at time, complexity and need. Always think about the bigger picture and the necessity of spending too much time making your code "perfect".

The Right Size Cup vs Feature Creep

The first time I made coffee I used these massive tea mugs thinking it would translate. It did not compute and I had a massive lukewarm watery brew! Picking up the right glass from Ikea made the ratios of coffee and milk perfect. Sure, you can give me a fancy cup, but if it makes the coffee shitty, slam, bam and yam to your fancy cup.

Feature Creep is one of those contested issues that most developers go through in their development career. I know it's something I have been working on in the past couple of years, especially with my own projects. We all want our product to be the best, but we need to have limits and goals that are achievable. There is nothing worse then having a project stagnate because it becomes a burden of tasks that never seem to get done.

A year later I finally have lattes to an art form. Every single day I make two of them each morning and I am happy to say that I am confident in my ability to create a great fucking coffee. As for my coding, there are so many things that turn us into great developers. Only with experience do we learn how to define these concepts and become the best at what we do.

Check out my Instagram account, onecoffeeshot, dedicated to my own coffee stories.