top | item 46820352

Ask HN: How do you force yourself to take breaks while coding?

6 points| glidea | 1 month ago

I'm a dev with zero self-control. "One more function" turns into 3 hours.

Tried Apple Screen Time – I just click "Ignore" every time. Tried Pomodoro apps – closed them when they got annoying.

What actually works for you? Hardware timers? Standing desks? Blocking software?

I'm building a macOS tool that uses full-screen overlays with a 30s cooldown to bypass, but curious what approaches others have found effective.

27 comments

order

dyingkneepad|1 month ago

I have the opposite problem: I have to force myself to not take so many breaks!

glidea|1 month ago

Haha, sometimes I'm like that too, but sometimes it's the opposite

6510|1 month ago

For me programming is the break.

JohnFen|1 month ago

I don't do this to force me to take breaks, but it does that as a side-effect. I am constantly drinking plain water while I'm working, which makes me get up to relieve myself every couple of hours.

glidea|1 month ago

Drinking more water has been mentioned many times, and it seems to really work.

gethly|1 month ago

This happens only if i am in the zone or working on something exciting. If that is the case, i absolutely do not want to break that streak for any reason whatsoever. Maybe you're a junior dev, but in time, these periods will become more rare and hard to come by. So enjoy it while you can.

glidea|1 month ago

The feeling of flow is indeed wonderful, but sometimes I get caught in the anxiety of not being able to complete a task.

Rembertir|29 days ago

been there “just one more function” is devspeak for disappearing into the void.

what helped me wasn’t forcing myself to shutdown, but giving my brain a clear signal that it’s time to switch gears. One simple trick that actually worked: before each coding block, I write down the last line I want to write before I stop. It gives me a natural off ramp and weirdly, my brain starts to anticipate that pause instead of resisting it.

On top of that, I use an app that’s built around nervous system regulation, not just timers or blocks. It actually changes how focused I feel while working. I don’t need to fight myself it gets me into flow and keeps me there longer, without the crash, music is pretty awesome too

glidea|28 days ago

Thank you. I understand that this is like setting a small, quantifiable goal; once you achieve it, there's not much to be anxious about.

WheelsAtLarge|1 month ago

I wrote a script that set an X countdown time to shutdown. The script gave a warning at five minutes and 1 minute until shutdown. Once I set it I could not stop it. It would load automatically at boot time. It worked rather well until I decided to stop using it. I don't have a solution for giving up. :)

glidea|1 month ago

Yeah I don't think any tool can fully solve this – it's ultimately a willpower thing.

the tool's job is to add friction, not to be unbreakable. Even if you bypass it sometimes, if it stops you from staying up late a few more times per month, that's a win

Curious – what made you stop using your script?

apothegm|1 month ago

Relatable.

I’d use a tool like that if it could detect video calls in progress and not lock the computer while that’s happening.

Current plan is to acquire a loud and obnoxious physical timer and place it somewhere I have to get out of the chair to turn off.

glidea|1 month ago

Haha, I thought of that too, setting a timer and placing it by the bed.

But later I either got too lazy to turn it on, or I'd just turn it off and continue.

If you're interested, you can also follow the software I'm building. https://forcebreak.zenfeed.xyz

al_borland|1 month ago

Drink a lot of water. The bladder can only be ignored for so long.

glidea|1 month ago

Honestly, this is probably the most reliable method. Biology > willpower.

I've tried the water trick but then I just hold it until I "finish this one thing"... which is the same problem.

dennisjoseph|1 month ago

I cook meals and do work in parallel.. you'll be forced to take breaks, to check on the steam, oven, air frier, marination etc.

glidea|1 month ago

Oh, time management master, bro

jryan49|28 days ago

Work on something you don't want to be working on. :)

hxugufjfjf|1 month ago

A dog actually works for me

vmt-man|1 month ago

I use classic pomodoro technique :) It helps even for my back.

glidea|1 month ago

Same, except I need to be more forceful.

abstractspoon|1 month ago

I have a cat

glidea|1 month ago

The ultimate interrupt-driven system. No snooze button. LoL..