An unexpected lesson from the ER

What sugary treats and technical debt have in common

Have you ever reached for that sugary snack after a long debugging session? I have. Or perhaps you've taken a shortcut in your code, promising yourself you'll refactor it... someday later? Both situations have more in common than it seems.

An Unexpected Detour

Yesterday evening took an unexpected turn when my son broke his wrist, landing us in the ER till late in the night.

Thankfully, he’s fine now. But I’m a morning person. And I noticed something. My usual resolve to eat healthily had vanished. I was giving in to sugary snacks and processed foods. Why?

The easy shortcuts

In "Thinking Fast and Slow," Daniel Kahneman explains that intense concentration – "slow" thinking – burns significant mental energy. When we're tired (physically or mentally), we're more likely to take the path of least resistance when faced with decisions.

In a study, participants were given a choice of a healthy snack and a sugary one. Those concentrating on remembering seven numbers gave in more often for the less healthy option.

Sound familiar?

As software developers, we face similar choices. Coding takes concentration, which takes mental energy and makes us more susceptible to bad choices like copy-pasting, hard coding values, skipping tests, and, generally speaking, taking the easy road.

But over time, these easy outs accumulate into technical debt.

Choosing the hard path

So, what can we do? Well as xkcd seems to believe, there isn’t always a good solution…

XKCD n° 844

However, there are three things I’m trying to do:

1. Recognise the signs: Be aware of when I’m tired (and cranky, to be honest!)

2. Build in buffer time: I’m trying to leave room for thoughtful coding and refactoring in my schedule.

3. Practice self-care: I prioritise sleep, exercise, and healthy eating. (Or I try to, at least)

Have you experienced decision fatigue in your coding? Let me know your stories and strategies :)

Latest content

I took the time last week to talk with Gil Hilderbrand about his journey as a developer, from college dropout to solopreneur on the way to 1 million in recurring revenue. He’s building an AI-powered Micro-SaaS. Gil provided helpful insights on how he is building his company and why he is using Laravel.

Fun things on the web

One

I’m keeping an eye on One, a new React Framework by the creator of Tamagui. Tamagui was a promising unified React JS + React Native stack. And One intends to use a client-side data management library called Zero. It doesn’t look ready for production just yet, however.

Next 15

At NextJS conf 24, Guillermo Rauch (who looked like he was also prepping for Movember 🙂 ) announced the public release of NextJS 15. He focused on how they have been trying to simplify NextJs’s mental model, in particular how data iss fetched

Thanks for tuning in, and feel free to let me know how I can improve this newsletter 🙂 

David from Kodaps

Reply

or to participate.