I’m passionate about software development, which is good since it’s something I do almost every single day. There are different approaches, methodologies and practices to developing great software, but the end goal is usually the same: create a tool that makes doing something easier or more enjoyable. The developer controls every aspect of the experience, and everything from the most complicated data management apps to one that lets you share cute cat videos with your friends is imbued with the distinct personality of its creator.
In the evenings, I go home from work and indulge in my other great passion: cooking. Over time I’ve noticed many similarities between the two disciplines. Both are rule-based, considered a science and an art form, and leave plenty of room for improvisation from the person doing it. Cooking and programming can also both result in either delicious and tantalizing outcomes or half-baked or overcooked ideas that leave a bad taste in your mouth.
In fact, software development and cooking are basically the same thing in my book. Here are the 5 things that cooking and coding have in common:
In cooking, a dish is broken down into lists of ingredients, like this example from my favorite recipe for fudge:
Apps are created in a similar fashion, with the programmer combining data structures instead of herbs and spices. There are many types of data structures used in software. For example:
Applications manipulate data in much the same way that cooking with heat alters the chemistry of the ingredients. It might be thousands of customer records, Instagram photos, or your smartphone’s app store — each can be broken down into basic lines of code that can then be recombined (aka cooked) to create complicated applications.
Once you have collected the ingredients you can move on to cooking your dish, with the recipe acting as a set of instructions that need to be followed to get the desired result. That sounds a lot like a computer application, which is just a set of instructions that tells a machine how to execute a group of commands.
Recipes and computer programs both lay out steps that need to be done one at a time and in a specific order, though some applications and recipes require multitasking to be accomplished. In the kitchen, I may have a sauce simmering on the stove while I’m also chopping vegetables or browning meat. When writing code, I may set up a system where a background thread processes an image while the user types in metadata.
At the end of the process, a good coder will present an elegant application, while a good chef will serve a tasty meal. In both cases, the outcome will be determined by the skill of the person who drew up and executed the set of instructions.
There are so many types of food — a different style for almost every country on the globe. In cooking, we call those cuisines. If your city has even a half-decent restaurant scene, you have a pretty good idea of the differences between, say, Italian and Chinese cuisine. Yet despite their differences, both styles of cooking have the same key ingredient at their core — the noodle.
Methods for developing software can also be broken down into “cuisines” based on the differing approaches of developers. Object Oriented Design is one of the most commonly used patterns, and is useful in software development because it allows teams to work together seamlessly. Telling a new team member that a project is following the Model-View-Controller pattern allows them to join development more quickly, the same way telling your dinner date where you’re going allows you to avoid any uncomfortable food-related standoffs — like accidentally taking a vegan to a steakhouse.
For those not culinarily inclined, a cookbook is just a collection of recipes bound together in book form. For example, I’m a fan of the Five Ingredient Cookbook, which is exactly what it sounds like — a collection of recipes all using five ingredients or less. There are also cookbooks written for programmers, which contain “recipes” that solve common problems encountered when writing code. If a programmer runs into a roadblock they haven’t seen before, they can consult a code cookbook for a solution. One example is the C# 3.0 Cookbook, though it should be noted that both chefs and coders now typically search the internet for new recipes or code solutions.
Programming and cooking are both arts and sciences. Just look at the college majors to study it: “Computer Science,” for the coders, “Food Science” for the chefs. Cooking and coding also both follow the scientific method, another mark of a true science.
The first step in the scientific method is to form a hypothesis. In cooking, this may be the idea for a new flavor or combination of flavors, while in coding it might be a new algorithm for solving a problem. Up next is testing the hypothesis through experimentation. This is the easy part — make the dish or code the algorithm. After experimenting the results need to be analyzed, which means running the newly written application or, better yet, taste testing the food. The results of experimentation can be used to improve your work the next time.
As for being an art form, it’s easy to see cooking as such — take one look at Instagram and see how much food is artfully prepared — but it may be more difficult for some to see coding as art. Why? Just because you’re clacking away on a keyboard? It makes me think of William Shakespeare.
What does The Bard have to do with coding? Easy, he’s a writer, and coding is just writing at its core, albeit writing done in a unique language. By writing efficient, readable code, a programmer can guarantee their program runs smooth, and makes their job and the jobs of others easier in the future.
The end results — whether they be a stage play or smartphone app — have the potential to invoke the full range of human emotions. If that isn’t art, then I don’t know what is. I bet you’re hungry now. Hungry for fudge? Peanut Butter fudge? Here’s my favorite recipe. It doesn’t take long and look! It has fewer than five ingredients. You can totally do this.
Brian Turner is a Unity Developer at Marxent. He brings fudge to all of our company parties. Well, at least some of them. It is mighty delish.
Marxent From #graphicdesigners, to #3Dartists to #projectmanagers, find out how our staff ended up here: https://t.co/5wSVtfO4Sk
Marxent If you think you can only use #VirtualReality with a headset - think again! #VRwithoutaHeadset… https://t.co/nzjpUj31hk
Marxent RT @ryanroche: One of my favorite things about @Marxent is this scholarship. https://t.co/932jY9Ol11