DEV Community

Aneeqa Khan
Aneeqa Khan

Posted on

How do you code when you are depressed?

Hello all, I want to know how you get yourself to code when you are depressed and sad and you can't do much about it, But you have office work to do.

Oldest comments (40)

Collapse
 
sherrydays profile image
Sherry Day

For me: Get something done first thing when you sit down.

That's it. Contribute something, anything to what you're working on, and sometimes that turns in to a really great day. And sometimes it doesn't — but that's the nature of the beast.

Collapse
 
tmchuynh profile image
Tina Huynh

I agree. It's making yourself start that's the hardest. That's why building good self discipline is key especially when you are motivated and on top of your game

Collapse
 
james_palermo_bc208e463e4 profile image
James Palermo

Sometimes I even start by just checking my local git repo folder or venv or docker etc and removing any experiments or clutter I don't need. Nothing more than looking through folders/containers and deleting what I don't need from local. That way I get some tiny momentum, and when you're depressed any momentum is good momentum.

Collapse
 
jballanc profile image
Joshua Ballanco

Reminds me of the famous adage:

How do you eat an elephant?

One bite at a time.

Collapse
 
booboboston profile image
Bobo Brussels

There are no easy answers, but on the day when you can't get in to it, maybe it's 3pm and you feel like you should stay sitting down for 3 more hours and work through it, your best bet is to get out and stop in that moment, and start from scratch the next day. Those three hours spent trying to power through are not going to help.

Collapse
 
brunoj profile image
Bruno

Exercise helps a lot

Collapse
 
cgifl300 profile image
cGIfl300 • Edited

I don't! I have a walk to the lac, well, I have to admit I don't really undestand depressives lol. regular breaks are as important as coding for hours (wich is highly not productive!).

Collapse
 
ben profile image
Ben Halpern

I think it starts with positive self-talk. Guilt can be a vicious cycle, don't treat yourself worse just because you are struggling.

Collapse
 
aneeqakhan profile image
Aneeqa Khan

My positive self-talk takes a turn and convert into regret talks 😄
But yeah once should try that.
Thank you! 😊

Collapse
 
michael profile image
Michael Lee 🍕

Try going for a walk.

Coding is problem solving.

I often get epiphanies or breakthroughs while doing other things.

You could look at the work ahead of you and tell yourself you'll focus on this problem on my next walk.

Then while you're enjoying the outdoors, focus on solving the problem.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Then while you're enjoying the outdoors, focus on solving the problem.

Or just focus on the outdoors. The solution will either come on its own, or it won't.

Collapse
 
michael profile image
Michael Lee 🍕

Great point @darkwiiplayer !

Collapse
 
evgeniigerasin profile image
Evgenii Gerasin

The best for me is to sit and do something. I set the timer to 20-25 minutes and trying to concentrate on the task. And i often go to the gym. The main thing is not give up

Collapse
 
james_palermo_bc208e463e4 profile image
James Palermo

I take my MacBook and drive somewhere like an empty park or back road, park, and work. Driving helps clear my head.

You can only push yourself too hard though. Reaching out like you're doing is helpful. I wrote a post about how lonely coding can be and the replies really helped me.

Collapse
 
aneeqakhan profile image
Aneeqa Khan

Thank you James! 😊

Collapse
 
james_palermo_bc208e463e4 profile image
James Palermo

You're not alone in this lonely world.

dev.to/james_palermo_bc208e463e4/t...

Collapse
 
james_palermo_bc208e463e4 profile image
James Palermo

I know you're coming from a good place when you wrote that but just in the interest of a friendly exchange of how intent can go awry, that kind of response to a question like "I'm depressed, anyone wanna share how they cope?" is maddening to me. Don't tell me what depression is, don't tell me what I should do about it, and absolutely do not suggest junk food is the cause.

Again. Not actually angry at you, just letting you know how it feels when you want some personal connection and someone explains your own brain to you.

Best,

  • Jas
Collapse
 
norregaaarden profile image
Nørregaarden

Amphetamine