Refactoring humanely and “accidental pomodoro”

tl;dr I’m still learning how to properly take breaks.

There’s kinds of refactoring where it doesn’t feel efficient to try to “push through” all the problems in a couple long sessions. It feels more efficient to proactively pause and break between sections to do other things.

This feels especially true when these factors are in place:

  • The refactor is rocky and roadblocks are many.
  • I can sense frustration building.
  • The risk of rabbit-holing on tangents and “getting lost” is high.

Somewhat normal observation for a senior programmers: When I stop working in these situations and come back later, I almost always see an instant payoff. Especially compared to grinding and wasting an hour or two “thinking in code.”

It’s hard to walk away

The hardest thing for me to do with a tough problem is leave it alone.

The dev in me wants to push through. I’m impatient, stubborn.

The clock is ticking. My product is dragging, it’ll never be launched.

Signs that it’s time to walk away

To help me get in the habit of “calling it” (time to break), I like to monitor if:

  • I find myself internally (or externally!) negotiating with the computer.
  • I’m noticeably annoyed, disappointed or frustrated when hitting a new, surprising roadblock.
  • I find myself driving down the same cul-de-sac (figuratively) in “one last attempt” to resolve something.
  • I’m acting without thinking, behaving reactively, relying on repeated trial and error vs. thinking methodically.
  • An hour has passed and I’ve been heads-down and focused.

Dev temptations

I’ve started negatively reframing these as “dev temptations.” Giving in to them and grinding leads to bad habits with consequences (I once had carpal tunnel so bad I couldn’t hold a cup or turn a doorknob).

But I have positive “temptations” too: that natural excited motivation to dig back in, the urge to build a new exciting feature, obsessing over pixel perfection in the UI.

Over the years, I’ve been workshopping different ways that let me give into the positive temptations while curtailing the bad temptations.

Recently, I decided to monitor myself a bit more closely and instantly react to any roadblock or negative “dev temptation” by taking a break.

I’ve been trying this for a few months, trying to build up some natural hygiene.

Accidental Pomodoro

When describing this idea in a private discord, my friend August said he does this as well sometimes, and called it “Accidental Pomodoro.”

I’ve tried Pomodoro and some of its variations. Most methods involve setting timers to break apart work. I’m a bit too…. rebellious…. to have something external telling me what to do throughout the day — especially yet another computer app interrupting me.

I’ve tried “softer” methods, including buying a set of physical hourglasses. That was nice for a while. They are timers I physically set, and they live passively in my peripheral vision. I’d sometimes forget about them completely after setting (a feature when giving into positive temptations) but they were good. They taught me a lot about my micro-estimation “abilities” (spoiler: I’m an optimistic person!).

All of the “timer” methods always felt like they had one big drawback. They interrupt my positive feeling of “agency” and “flow” in the name of sustainable pacing. I never really liked that trade-off. I want to get happily “lost in the sauce”, but prevent that sauce from souring.

Proactively taking breaks

During this current refactor of mine, I’ve been ridiculously proactive. The minute I register a negative “dev temptation,” I’m getting off my computer to go do something else.

If an hour has passed without a break, I’ll proactively take one anyway. It’s always nice to catch this at a “natural” spot of rest within the dev cycle, when things are happily compiling, etc. But that’s not the priority. The priority is the break.

This particular refactor is tough. I’m hitting new roadblocks every 15 or 20 minutes. Taking a break each and every roadblock feels aggressive! It almost feels wrong, lazy, counter-productive. It could mean I’m taking 10+ breaks a day that add up to hours of “not working.”

Other ways to break

My low bar for a “break” is: Removing my body from the computer for a couple minutes. I need a clean break from “sitting at the screen.” Otherwise things stay in a messy gray area (am I on break? am I working? is this procrastination?).

I’ll often wander into the kitchen to do some dishes, make a cup of coffee, or just to go sit on the couch and scroll a bit (dangerous for other reasons).

Standing desks are great for this. When standing, there’s zero friction to “walk away,” literally — even if it’s just to pace around for a couple minutes.

Proactive “dev walks”

My friend Ben does multiple “dev walks” a day. Inspired by him, I’ve been taking at least one “dev walk” around the block after I’ve worked my first hour.

Nothing groundbreaking or complicated. Just a 15 minute walk around the neighborhood after doing that first bit of work.

If “sleeping on it” is an S-tier break, this feels like the A-tier. I am pulled out of my narrow focus, get my blood moving, and remember the rest of the world exists. It proactively subverts any budding negative “dev temptations.”

I used to not really “get” going on walks. It also took me an embarrassing number of years before I “got” exercising daily and seeing the obvious positive effects on my mood / brain. (A workout is also an S-tier break for me, especially if it involves leaving the house).

Payoff #1: Reduced frustration

I’m a passionate and persistent person — it takes a lot to deter me when I have my mind set on something.

This can work against me: frustration and doom can build slowly over days and weeks on longer projects. It sneaks up on me. So does the weight of sunk costs.

Being proactive nips that in the bud. It just doesn’t build up. My self-awareness has improved. My “bad hand” doesn’t get sore like it sometimes still can.

Payoff #2: Hijacking the knee-jerk

Hitting a new roadblock, my internal monologue can veer towards: “Fuck, this means I have to do this awful hack X, or write all this new code.”

If I go away and come back, I sometimes have forgotten what the exact problem was. The details are flushed from working memory. That gives me a second chance to calmly reassess before taking action.

Often, the situation isn’t as dire as I first thought. It’s not that important. Instead of some new long arduous journey, it turns out there’s a nice clean hack that’ll take 5 minutes to get going again.

Payoff #3: Removing the emotion

When grinding away at the computer, my thought process, my work, my emotions are all one “experience” — they happen in one physical location.

Proactively taking breaks helps any emotional disruption to settle. Even when it’s small, not yet detectable.

If I manage to get overtly frustrated, I’ll make it a point to not go back to work until the frustration has simmered down and motivation has taken its place again.

This can take a while! It can mean bailing out of the work “shift” altogether, grabbing lunch, exercising, calling it a day, sleeping on it, etc.

In every case, it’s the right call.

In every case, it’s hard to feel sure it’s the right call until after the call was made.

Conclusions

Here are my current conclusions:

  • Sustainability matters unless I’m building something trivial. (I’m not, I’m 4 years into a big solo project).
  • Walking is obviously good. We’re built to walk and think. I probably can’t walk enough. One day, I’ll be like my friend Ben who does 3-4 walks a work day.
  • It’s easy to lose track of what my task actually is. Changing one’s physical setting makes it easier to “zoom out” and regain perspective.
  • “The brain is a muscle.” It feels correct to me that it’s not possible to engage the brain in sustained periods of high intensity attention without performance degradation. Regularly giving it a chance to relax seems like a great idea.
  • Limiting the total amount of brain-time per week is good for my long term. I made it a rule when I used to run a refactoring consulting company to only bill customers for 5-6 hours max a day. I don’t believe people can give more than that amount of daily brain at peak performance, day-in, day-out. A “good” average seems to be more like 3 hours/day.
  • “Work” happens in the breaks anyway. Definitely while walking. Even when distracted. Anyone with workaholic tendencies knows what I mean. But also emotional work, processing, negotiating, morale-building, etc.
  • “Diversity of activity” is important to how “free” and “creative” I feel as a human. Context-switching into “real life” is vital. It’s the sort of thing that feels higher friction when not done regularly.

My context is specific

I work from home, and have for 20+ years. I’m also a night owl and will often work an extra shift after dinner. Taking several hours worth of breaks in a day might sound luxurious to someone in a different position.

I have definitely felt awkward when bringing this up with traditional nine-to-five peers. But I have other friends, some in their early 20s, who seem to know exactly what I’m talking about.

Taking many frequent and proactive breaks might sound impossible or excessive when working out of an office. Ironically, I find offices already excel at providing regular distraction and physical displacement (physical meetings, water-cooler chats, grabbing lunch). It all washes out in the end.

In my mind, knowing my limits isn’t a luxury. It’s efficiency. But it’s also more than that. It’s an ongoing process to work in harmony with my needs as a human being — a physical body with limits and emotions that moves through time.

On bad days, I’ll boil it down for the caveman programmer inside of me: 2 hours of breaks > 2 hours wrong direction + the rest of the day frustrated.

It’s an additive beast with 1000 oscillators
and a ton of fun sound shaping tools

Check it out

Leave a Reply

Your email address will not be published. Required fields are marked *