I Code With a Pen
November 08, 2018
Sometimes, I struggle to look at the bigger picture when I’m in code mode. I’ll get caught up in implementation details and the excitement of naming variables and other low-level problem-solving. When I get like this (which is often), I wind up trapped in a loop of starting a potential solution, then realizing it won’t work, then diving into another half-thought-through idea and then realizing that’s no good either.
It can take ten, twenty, sometimes even thirty minutes before I realize what’s going on and decide to step back and look at the bigger picture.
But when I do, I have one tried-and-true solution to allow my brain to unwind and take in the problem as a whole: close the laptop. Or, at least push it away.
Then I pull out my trusty pen and notebook. There’s something about the solidity and physicality of a pen in my hand and a piece of paper to write on that allows me to zoom out to ten thousand feet. It pulls me away from short-term concerns and puts the focus where it needs to be: on the larger scale design flaw, the architectural issue that is the real source of the confusion.
The first thing that happens is that I’ll end up thinking through the entire solution before getting too invested in building any one part of it. This means I catch those architecture-level problems at the conceptual level, saving me time and energy and breaking the loop.
I don’t have to worry about exactly how that function will do what it needs to do, because I can’t even figure it out anyway without being able to look at the surrounding code. I wind up focusing, in a very natural way, on the principles of well-separated code. I define functions that do just one thing (because it’s easier to see how logic is divided when you’re not trying to get the thing “to just work” and slamming everything down in one place) and are well-named.
I always write with a pen, because pencil is too temporary and allows me to jot down thoughts without needing to fully think them through. The permanence of a pen lends a weight to my thoughts that allows their momentum to carry them through to their natural conclusions.
Which is a fancy way of saying “I don’t want to scribble out anything in my notebook, so I think about what I’m going to write.”
You can’t scribble out code. There’s no motivation to think everything through, because it’s just too easy to delete it and start over again. So when you’re stuck in that ‘write, think, delete-it-all’ loop, take a breath and pull out a pen and paper.
You’re welcome. 😉