Kitchen coding

[Tweet : ADN : nvALT]

I’ve developed a love of cooking. Perhaps even an obsession. It’s been good for my diet, and good for my palette.

When my mental health providers cut off the stimulants I had been taking for a decade to treat my ADHD, the only real upside to the new regime was that it was really easy for me to stop working at the end of the day (if I made it that far). Because my brain wouldn’t let me sit at a computer for any extended period of time, I ended up having free time in the evenings.

I’ve always been decent in the kitchen. Kind of like I’ve always been decent at coding, writing, and even sports1 in my younger years. To the extent that I could make it work, anyway. But, like coding, I decided there were things I could do better and started studying my meals in detail.

I had read most of Cooking for Geeks, and began to really see the relationship between chemistry and cooking. It started to get fun.

Now this isn’t a new or groundbreaking statement, but—much like learning guitar after years of piano and suddenly seeing frets as keys—I found the parallels between coding and cooking to be stunning in breadth.

Recipes are other people’s code

When sites like Google Code, BitBucket, and GitHub became a reality, learning to code got dramatically easier for me. I learn best by seeing something work, and then reverse engineering it. It’s actually the only way I learn with any efficiency.

Sites like Yummly have quickly become my GitHub for cooking. I can download and run a recipe, see the results, and in the process of executing the recipe code, I learn how each part works.

And like GitHub, you can copy and paste code, but you learn a lot more if you examine it, break it down, and then rebuild. Along the way you learn skills, syntaxes, and concepts that allow you to bend it to your will.

Genres are languages

There are algorithms that cross all boundaries in cooking. Understanding things such as glucose breakdown, deglazing, and ordering ingredient combination to allow the optimal heating time for different cellular structures are all valuable skills across any genre of cooking.

However, cooking Italian varies drastically from cooking Thai. The base ingredients are different, the way that using Ruby constructs in Python will bite you every time. Each genre has its own syntax, if you will, and things that work in one genre require some translation to work in another.

Learning the basic algorithms (zesting a lemon, caramelizing onions, separating models and views—oops, mixed analogy) serves you well across languages.

Unit testing

Unit testing in programming can be complex without proper forethought. It’s a lot easier in the kitchen. Once you learn how things are going to fit together, you can taste test and season each section of the recipe individually. Running a complete set of tests as you build allows you to retry a smaller section without having to toss the entire product.

Multithreading

Just like learning multi-thread memory concepts, once you understand a recipe sufficiently, you become able to have multiple pots on the stove, something in the oven, and still have time to chop ingredients for the next phase. I’ve taken meals that initially required 3-4 hours of kitchen processing time and turned them into 30-40 minute projects.

Material cost

I’ve quickly learned that dried basil is not the same as fresh-chopped basil. I prefer to use fresh ingredients for everything (I might make exceptions for lemon juice, and when garlic is minced instead of sliced, I’ve found that a jar of minced garlic is usually as good as anything I peel and press by hand).

That gets expensive, whereas writing code doesn’t have a grocery bill. However, when you total up the amount I spend on computers, text editors, input devices and other hardware, I think cooking—even with the initial cost of good pans and utensils—ends up costing less over the course of a year.

Side note: Paprika

As an aside, Paprika is my favorite recipe manager on both Mac and iPhone. I can convert a web recipe into a Paprika recipe in seconds. I can tag, sort, rate, and add notes to them. They sync seamlessly across devices. It can even schedule meals for the week and generate a shopping list with a few taps.

It also has multiple timers that you can name, and automatically detects time units in a recipe. Tapping one pops up a timer with an assumed name, and you can edit title and duration before hitting “start.” When a timer goes off, it rings and shows you the title, and you can quickly add a bit more time if needed. My only request would be an Apple Watch companion.

I generally use Paprika on my iPad with a Belkin Kitchen Stand and stylus (pumping some 70s soul—my ideal cooking music—to a JBL Pulse).

There are more detailed cooking/coding parallels I could go into, but I really need to check the oven. Feel free to browse some of my kitchen photos!

  1. I was good for a pickup game of basketball, enjoyed soccer, and was OK at flag football. I was an all-star pitcher in fast-pitch softball. Ultimately, though, I gravitated toward less team-oriented sports like mountain bike racing and getting into bar fights.