All posts

What boxing taught me about writing software

· 3 min read

A dark boxing gym with leather heavy bags hanging above an empty ring.

I started boxing because I wanted a workout that didn’t feel like a workout. A few months in, I realised it was teaching me more about my day job than most engineering books I’ve read.

Defence comes first

Most of my training is defence: keeping my guard up, slipping, blocking and moving out of range. I don’t spar in the ring. The drills still make one thing very clear: the moment my guard drops, I’ve left an opening, and the coach points out exactly where.

Production bugs feel the same. Something breaks, it’s a little embarrassing, and then it tells you precisely where your guard was down. That’s the useful part. The only real mistake is leaving the same opening twice.

Footwork before power

Every beginner wants to throw big punches. Every coach makes you skip rope and shuffle in a box for weeks first. Power comes from your feet; if your balance is off, your best punch is useless.

Code is no different. The clever part, the fancy algorithm or the elegant abstraction, sits on top of boring foundations: good names, small functions, tests that run fast. Skip the footwork and the clever part falls over the moment someone pushes back.

Breathe, then react

When you’re tired and someone’s coming at you, the instinct is to panic and swing. It never works. The fighters who look calm aren’t stronger; they just breathe out, see what’s actually happening, and pick one sensible move.

Incidents at work reward exactly that. The first five minutes of an outage are when people make the worst calls. Take one breath. Read the error. Check what changed. Then act.

Rounds, not marathons

A boxing round is three minutes, then a minute of rest. That rhythm lets you go hard without burning out. Trying to fight for twelve minutes straight is how you end up flat on the canvas.

I’ve started working the same way: focused blocks, a real break in between, away from the screen. I get more done in four honest rounds than in a whole day of half-attention.

Leave your ego at the door

The best thing about a boxing gym is that nobody cares what you do outside it. The person next to you on the pads might be a student, a doctor or a delivery rider. You learn from whoever is better at the thing in front of you.

Code reviews work best in that spirit too. The comment that stings is usually the one that makes the code, and you, better.

What I’m still working on

My jab is fine. My defence is a work in progress, in the gym and at my desk. But the openings I leave now are new ones, not the same old ones, and I’ve learned to count that as progress.

If you’ve been thinking about trying a combat sport, do it. Find a beginner class, buy a pair of wraps, and expect to be humbled. It’s the best kind of humbling there is.

Was this useful?

Mohammed Ashfaq Ahmed

Senior Software Engineer at Confluent, based in Hyderabad. I write about building software and what I learn along the way. More about me