Code Like a Chef: Work Clean
blog.baugues.com
blog.baugues.com
“I worked with a chef who used to step behind the line to a dirty cook’s station in the middle of the rush to explain why the offending cook was falling behind. He’d press his palm down on the cutting board, which was littered with peppercorns, spattered sauce, bits of parsley, bread crumbs and the usual flotsam and jetsam that accumulates quickly on a station if not constantly wiped away with a moist side towel. ‘You see this?’ he’d inquire, raising his palm so that the cook could see the bits of dirt and scraps sticking to his chef’s palm, ‘That’s what the inside of your head looks like now. Work clean!‘”
But the actual code I'm working on? That stays (relatively) clean.
Professionals realize that “quick and dirty” is an oxymoron. Dirty always means slow!
This depends on what timescale you're considering. If the way that was less work in the long run was always also less work in the short run, technical debt would not exist.
The cleanliness of a workspace is invariably reflected by the product made in it.
This is why your autobuilder should be set to make a clean checkout every time. It gets rid of any mess, so you know exactly what the inputs were that got you your output.
How would you feel eating food from a filthy kitchen? How can clean code come from a dirty desktop?
Because your 20 open browser tabs are isolated from your email which is isolated from your IDE. Food is a physical item which can pick up contaminants from physical surfaces it comes in contact with. The code in your IDE is not a physical item and does not come in contact with your browser tabs. The analogy doesn't work.
But you are right - professional chefs have so many things going on at so many different stages of prep that it makes us coders look mono focused.
My favourite conference talk for a long time was at UK PyCon this year - where the presenter wore a chefs outfit and discussed the important parts of developers toolkit in an outrageeeeouuus Fraanch accaant - including a picture of many small copper pans (ze sauce control).
i've worked at places where the most brilliant, clean code comes from the minds of veritable slobs. i'm sure the "clean, organized" approach works for many, and it is definitely a good mantra to live by, but to assume that it's the only way to achieve good clean code is a bit arrogant.
I have no problem with learning an idea which might for someone and so might work for me.
But whenever some approach of this sort gets currency, it has the danger of going from a useful idea to use if you like to a stricture managers repeat useless.
I would hazard to say coding is different from cooking or woodworking in that the coder has to draw from many more sources and leaves many more open loops (And I actually cook and code professionally, oddly enough).
I'm similar to the author in that using a window manager, killing all my chrome tabs periodically, and writing down meticulous notes in Evernote help keep me organized and focused on the task at hand, but obviously this will look different for different programmers.
This post makes me think I'm on the right path.
I feel like IDEs have forgotten that the first letter stands for 'Integrated' as they leave us jumping around from one place to another.
My goal is a simpler interface to improve the focus on the task at hand. Maybe not as minimalist as Light Table, but easier to use than the IDEs I've seen. Just started coding, so a long way to go.
Every additional program I have open is a potential distraction. Every single one of the 20+ tabs I have open is a potential distraction. When I'm on my desktop, I can afford a bit of that. I can move some distractions to the monitor on the right and place it behind something else. But I still make a conscious effort to cleanup my workspace regularly.
I didn't think those extra open tabs had an effect on me, but they do. They're a constant reminder of the many things I have yet to work on, and the significant impact they (can) have on my life and family. Removing those tabs and windows to focus only on the task at hand has been tremendous in helping me with my constant state of anxiety.
If clients pop by and want to see how you are doing on their project then swap to the required desktop and every terminal window and every browser tab relates to their project and nothing else.
You can also have a desktop with your own stuff on it, i.e. with all the distractions, and not have to fret about closing it all down. Pick up with your distractions where you left off.
When you are done fixing whatever for project whatever you can simply close down the browser and terminal windows on that desktop, you don't have to sift through your tabs.
If you do need to change focus from project A to project B then it is a simple switch, not a mess to wade through.
On mac spaces with full screen apps and the 4 finger swipe gestures work well. Feels awkward on medium or large screens though.
Since i switched full time to GNOME again, i've been trialling this [auto move windows extension]( https://extensions.gnome.org/extension/16/auto-move-windows/). Seems to be working quite well so far.
I once read that Japanese construction sites would sweep up, clean their tools and put all them away at the end of the day. I don't know if it is true or not. But it got me to shutdown all my apps at the end of the day.
My editor is never left open. I shutdown my VMs. Then in the morning I start fresh and clean.