HACKER Q&A
📣 lifeplusplus

Can't get into right headspace to code?


basically have been complete demotivated, don't feel like reading anything, instead just want to watch movies but barely enjoying them. Kinda feel indifferent to any work related task. Even if I force myself to open the IDE and read few things, I just start falling asleep, but when I think ok gonna do this tomorrow all the sudden I instead wanna play something or watch.


  👤 throwaway81523 Accepted Answer ✓
First of all, make sure your sleep and nutrition is up to snuff, that you're getting some sunlight and exercise, and you're not getting sucked into too many distractions like the internet. Delete all your social media accounts. They are bad for you. Yeah, HN too, though less so or at least we like to think. Also, take vitamin D supplements unless you're outdoors a lot more than most people are.

If after that, if it's general mental or physical fatigue, it might be medical. Are you able to passively take in information, like watching TV attentively without getting distracted/tired? If not, then yeah, suspect medical or psychological issues. Everyone gets that way sometimes, but if it persists more than a few weeks, talk to an MD.

If you're having trouble beginning code tasks, then work on stuff that you're already in the middle of, write documentation, go through the bug list of whatever you're supposed to be working on and fix issues, etc. This can get you back into it.

I think really great programmers are in an inspired, highly productive mode almost all the time. Ordinary pretty good programmers (most of us here) are in that mode some of the time, and need to develop the skills and habits to keep plugging along when we're less inspired. That is partly a matter of technical fluency: be very familiar with your tools, languages, environment, code base, etc., so you can keep cranking without having to get too overwhelmed by uncertainty and confusion.

There is a long time stereotype of hackers staying up all night coding, and that is partly because there's a time around 4am when psychological resistance to doing stuff dissolves. So if you are stuck on something, deciding to pull an all nighter can actually help break through, even if most of the night is not productive. Don't do that too often though, and never do it 2 days in a row.

Other than that, I guess we would have to know more specifics.


👤 dredmorbius
When's the last time you had a real vacation?

This sounds like exhaustion, possibly burnout.

It could also be something more serious. You should consult physical & mental health professionals.

Look up the Maslach Burnout Inventory and request that specifically to rule out burnout:

https://en.wikipedia.org/wiki/Maslach_Burnout_Inventory

In general, don't seek or follow medical advice online. Including on HN, or from me.


👤 matesz
"It's one thing to concentrate deeply and think, but it's another thing when you are simply hesitating, when you are unable to make up your mind, that's a sign of other problems"[1] - Vishy Anand

[1] https://youtu.be/BmmRQjzutEI?t=23