THE CODER AND THE COOK

Ramsey Njire
6 min readSep 4, 2017

You’re probably thinking this is going to be another post about how coding is much like cooking. You’re right. In fact, the number of times parallels have been drawn between the two is such that this storyline has become a tired cliche. But hey, here I am, shamelessly continuing the tradition. You know why? Because while reinventing the wheel is totally redundant in the grand scheme of things, usually it defines monumental growth for the individual who did it. Give me a few paragraphs and I’ll show you exactly how I did it.

Last week was full of me losing sleep over the Andela Bootcamp. Due to the fact that I didn’t have an internet connection at home, I spent most of my time at my friend’s place. He works as a freelancer and so he lives entirely on the World Wide Web. So that’s where I was, leeching him of his internet and electricity all week (I thanked him at the end of the week, if it makes me seem more grateful) and starving the bedbugs on my bed back home.
To be honest, it feels like 10 years ago. It was paradoxically the longest and shortest week of my life, all at once. Long because I did so much that I felt I had crammed an eternity’s worth of labour into 7 short days(Yes, I worked on Sunday too). Short because no matter how much I did, I was never quite done with the job at hand. But that’s a story for another day…
As is usual when you work for long periods of time, I got hungry. This was on Saturday evening and my friend, his brother, and myself were all in the house. We decided to cook and, somehow, it was unanimously decided that I should prepare the stew (We were having rice).
I have never considered myself a good cook, but I didn’t complain about it. I rarely complain about much. I always feel like time spent complaining is time spent not finding a solution to the problem; not that I consider cooking something I will eventually eat and enjoy a problem but you get what I mean. So I got to my feet and started deliberating on what I intended to be the greatest stew my friend and his brother ever had.
I knew what I was going to make in my head: Beef stew. There would be the usual onions and tomatoes that you find in virtually every stew in Kenya. Then I would add dhania to the mix. Maybe a bell pepper (pilipili hoho in Swahili) or two, some actual peppers, ginger, and some peas. Now, this was the easy part. Getting the ingredients is usually the easy part.
So I went and bought everything, making sure to bargain down everything I could to the last shilling. It’s the Kenyan way, after all.

You would think that would be it. The ingredients are there so now all that’s left is the cooking, right? Wrong! Getting back, I realised I had forgotten the matches. How the hell was I supposed to light up the gas cooker? So I rushed back and got a box of matches. Then I got back and realised all the dishes were so dirty there was a holiday resort for cockroaches going on in the sink. I had to clean those dishes, ruining some holidays in the process(I bet a lot of cockroaches went home to a silent treatment from their sulking wives after that ruined outing). Then I had to get the beef ready. That meant cutting it into cubes, which required a sharp knife. Gosh Darn! I needed to sharpen the knife! Then there was the peeling of the tomatoes and the slicing and dicing of the other stuff; the dhania, bell peppers and ginger.

Then came the cutting of the onions. Cutting onions puts funerals to shame. I cry so much my body thinks I’m really sad and starts making all these ridiculous convulsions and sobs. Really, I think it’s ridiculous. Here you are, going on with your life just trying to murder some onions and they decide that they’re going to make you cry. No poison, no bitter taste, no thorns. Their defense mechanism is literally forced crying. It doesn’t matter if you just got married before cutting them up or got a raise at your job or heard the funniest joke in the history of humour. Those little devils will make you cry. It doesn’t matter if you’re Cinderella or Dwayne ‘The Rock’ Johnson. YOU WILL CRY. Am I the only one who finds it ridiculous?? So how do I cope with it? I make up a story to go with the crying so it seems less ridiculous. Before I cut up the onions on Saturday I put on some sad music and pretended I was a freedom fighter at a detention camp. I’d been there for 5 years straight and my wife had come for the first conjugal visit. I don’t care who you are; after a 5-year dry spell, when someone gives you the opportunity to break it, you will cry. But I digress…

The beef needed boiling. With just the right amount of water so Jesus wouldn’t come back before the water had all evaporated. Then there were the peas, which also needed boiling. Then I needed to fry the onions, which meant I needed some cooking oil. We were fresh out of oil, so I had to rush to the shop again. Why didn’t we think of this before??? Then the oil gets bought and you have to put in just enough so the food doesn’t taste wrong. Did I mention that we boiled the meat with the chili and ginger? We had to grind the ginger first, by the way. It helps to tenderize the beef so it’s not too chewy later on.

I could go on and on about all the little intricacies and new developments that came up in the process of preparing that meal but that’s not the point of this post. The point is to show where the analogy comes in. Coding is much like cooking. When you’re cooking, especially for the first time, you think you have everything mapped out in your head. Then you actually start and realise there are all these things you need to sort out along the way. New developments you need to figure out, etc… Of course, by the second or third time you’ll have gotten the hang of it and everything will come naturally. But the first time is always the hardest.

I think that was my greatest lesson last week. I was ‘cooking’ a shopping-list-app. But not only did I not know all the ‘ingredients’ beforehand, I didn’t even know whether to boil the onions or fry the tomatoes, not even the order. I was learning to cook as I cooked. And that was the point. It would be hard the first time, but I would get the hang of it with time. I realized that if I kept on hacking at it long enough, I would probably be so good one day that I would be writing the programming equivalent of recipes: Elaborate algorithms. And just like with cooking, I would have to adapt to new developments as they came up. This revelation made me so proud of my progress, I was feeling like quite the ‘code-chef’ by Sunday.

I have never learnt as much in a week as I did last week, and probably I have never faced as many challenges either. But that kind of pressure does things to you; makes your vision a little clearer about things. Looking back, I wouldn’t have it any other way.

PS:

You must be wondering if the food turned out as great as I had intended for it to. Well, I don’t know for sure. They tasted it and I watched them keenly as they moved it around in their mouths. There was an intense look on their faces, like they were grappling with a problem of great importance and they needed to solve it soonest. Then my friend swallowed with an audible gulp. And then he spoke, “Hmmm… Needs more salt.” Come to think of it, there’s another similarity with coding. No matter how well you think you’ve done it, it always needs more salt.

--

--

Ramsey Njire

“I am neither especially clever nor especially gifted. I am only very, very curious.” — Albert Einstein