August 30, 2012 - 12 comments

Code Like a Chef: Work Clean

There are a dozen opinions on any given cooking technique, but in the Alinea kitchen, when you say "TK says..." that's the end of the discussion.

Thomas Keller is considered by many to be the best chef in America, and almost certainly the most influential. His NYC restaurant, Per Se, is ranked the sixth best restaurant in the world (edging Alinea out of the spot it held in 2011). In 2003 and 2004, his The French Laundry, was named the best restaurant in the world - the first American restaurant to hold the honor. Grant Achatz, chef of Alinea, spent six years at the French Laundry - and so influential was TK's friendship and mentorship that Grant named his eldest son "Keller".

In Ad Hoc at Home, TK says:

Being organized - as we say in our kitchen, 'working clean' - is a skill to develop. We call it mise-en-place, French for, literally, ‘put in place.’ The term can be very specific, referring to ingredients needed to complete a recipe, measured out and ready to use, or it can be more general: are you organized, do you have everything you need to accomplish the task at hand?

Good organization is all about setting yourself up to succeed. It means getting rid of anything that would interfere with the process of making a recipe or preparing an entire meal. If you are in the middle of preparation, you don’t want to stop and find the proper pot, or dig around in the cupboard for an ingredient: that opens you up to distractions and errors...

When I peel an onion, I get rid of all the onion skin before I begin slicing it... When you finish with a pot, wash it. Clean as you go to avoid clutter; clutter interferes with the cooking process. Things get in your way when you’re not organized. Clear your path.

Being organized is the first and most important part of cooking.

Working clean is the most valuable concept I have adopted from the kitchen, for I am not an organized person by nature. At the office, working clean takes two forms. First, I keep my physical workspace clean. Dirty dishes, papers and knick knacks cause me visual distraction.

More importantly, I am continually cleaning my virtual workspace. If I’m not careful, by mid-afternoon my desktop looks like this:

Every file I’ve touched throughout the day is open. I’ve got a couple open docs, maybe a spreadsheet or two, unrelated to what I'm working on. Email's up, begging for my attention. I see guys brag on twitter about how many browser tabs they have open at the end of the day. I don't get that. Forty open tabs are a sign of a disorganized and unintentional mind. It's sloppy.

When I'm on my game, my desktop looks like this:

Everything is put in place. My editor takes up the left two-thirds of my external monitor - tests on the left, production code on the right. Terminal goes in the top right, time clock below that. My browser stays below on my laptop monitor - but only when explicitly needed. Email does not stay open.

When I finish the task at hand, I reset. I ⌘W all the way down. I take off my headphones, step away from my computer, and shake out my legs. I ask myself: Is there anything that I can do to prevent being interrupted over the next hour? Do I need a break? Do I need to use the bathroom? Respond to email?

If not, I get my mise en place for my next task. If I need a rails server, I start it. I open the code and tests that I’ll be working on along with any docs that I know I'll need.

The goal of a professional programmer is to produce clean, organized code. Software veteran Bob Martin wrote two books on this topic: Clean Code and The Clean Coder. In the latter he says:

The way to go fast, and to keep the deadlines at bay, is to stay clean. Professionals do not succumb to the temptation to create a mess in order to move more quickly. Professionals realize that “quick and dirty” is an oxymoron. Dirty always means slow!

We can avoid pressure by keeping our systems, our code and our design as clean as possible. This does not mean that we spend endless hours polishing code. It simply means that we don’t tolerate messes. We know that messes will slow us down, causing us to miss dates and break commitments. So we do the best work we can and keep our output as clean as we can.

The cleanliness of a workspace is invariably reflected by the product made in it.  TK says: "We're taking great measures at making sure that we have an environment that's very wholesome, very clean, very well organized so that there are no opportunities for food-borne illness."

How would you feel eating food from a filthy kitchen? How can clean code come from a dirty desktop?

If you found this post interesting, you may want to check out others in the Code Like a Chef series: 

Also, I'll be giving a lightning talk on this topic at Windy City Rails next week. 

Published by: Greg Baugues in Developers


August 31, 2012 at 11:57 am

Absolutely correct… I go a bit further, not a sheet of paper in my office, after taking notes at a meeting the important info goes in a doc. Then docs and email purged when no longer useful. Why keep it around for 6 months when the last time you looked at it was 6 months ago…

Excellent article

Casey Wise
August 31, 2012 at 12:21 pm

Awesome article, thanks for sharing! Are you using ST2 as your editor there?

August 31, 2012 at 1:37 pm

Very cool! I try as well to keep my desktop as clean as possible. I use my Temp dir to the files that come’n’go like the wind (with hotkey shortcuts on my keyboard to get in and out quickly). I also try not to maximize windows, with BIG lcds we have. With few unmaximized windows open, you can quickly get the lay of the land and see what’s open and “need to do.”

Cool article, back to work. 🙂

August 31, 2012 at 2:53 pm

Hi Greg,

very nice series of articles.. have read all four of them and it is very inspiring. the very first thing which I’m going to do now is organize my computer desktop and move in to tool-mastering ( in my case its visual studio ) . the tips on making a prep list for a task at hand before actually getting in to coding and put an end to multitasking ( chat + fb ) are very helpful indeed 🙂 I was worried about the way I perform as a software developer and I believe I found some insights about what the problem might be once I’ve read these series 🙂

Thanks very much,

August 31, 2012 at 6:16 pm

Dear Greg,
Congratulations for this excelent post about how to be clean.
I see that you’re using this amazing text editor called Sublime Text 2, but you have a little issue in your desktop: you need to buy a license and use a registered version to develop, but this is may be another topic to post, don’t you think? 🙂

Think about it….

August 31, 2012 at 5:16 pm


Thanks for the article, it was a great reading!

Could you, please, tell me what’s the app below your terminal? It must be very important in your workflow as it is next to an editor and console.


    Greg Baugues
    August 31, 2012 at 6:41 pm

    TXI is a consulting company, so we track all of our hours using Harvest. That’s their OSX app.

kung foo man
August 31, 2012 at 6:52 pm

Its nice to have most tabs closed, but as developer there is alot to stuff to lookup. Also stuff you cant do NOW, just because you need the information later. Tab-groups in firefox are very good to keep all tabs open, sorted by topic.

    Greg Baugues
    August 31, 2012 at 6:57 pm

    Agreed. I still end up with 15 tabs open at times. Do you know if Chrome has a tab-group equivalent?

Peter Knight
September 3, 2012 at 5:07 pm

I get cranky when I return to some of my older code and it hasn’t been structured and coded in a clean organized way. Not having to work with dirty code in a ‘dirty’ environment makes working on projects a hell of a lot more pleasant and that psychological win turns out to be a time saver in itself.

Leave a Reply

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