r/AskProgramming • • Oct 07 '20

Careers Does anyone else with a programming job just feel mentally exhausted just working a few hours?

Especially when I’m stuck on something, I lose so much motivation and want to quit working and think I should just start delivering for Amazon or something. It’s so hard to get myself to keep going... and idk how to fix this.

I just started working about 6 months ago, and everyday I start off strong but lack so much motivation when I hit a wall. What can I do to keep me more motivated? Anyone else in the same boat as me?

Edit: Just took a bunch of your guy's advice! Took a break, looked through the thread, went out for a run, and then changed my task. Was able to get through the newer task, felt a lot better and more motivated. Thanks for all the advice!

133 Upvotes

60 comments sorted by

41

u/JacobFarms Oct 07 '20

Taking breaks throughout the day is your friend

25

u/[deleted] Oct 07 '20

Problem is I take a break, and just have no motivation to go back and face that problem again.

29

u/stratocastom Oct 07 '20

Every coder I know experiences this (often daily). In fact, if you don't get this feeling often, then I'd say you're not challenging yourself enough!

Hopefully you've got enough to do that you can just switch to something more menial when you feel burnt out. It's a great skill to know when you're beaten (for the time-being), and take a break/move on to something else. You'll also often come back and find the problem unravels itself.

If you don't have a good mix of taxing/menial tasks, maybe speak to your manager or consider whether the job's right for you.

8

u/[deleted] Oct 07 '20

I think I should try that, I always stick to one task and end up wasting so much time being stuck on something. I should try doing something different that's easier

5

u/VirtualLife76 Oct 07 '20

It can be a challenge to switch tasks, but it can really help to look at the problem from a distanced pair of eyes.

1

u/stratocastom Oct 07 '20

Yeah, it definitely helps with your confidence to move onto (and finish) something else. If you're finding that everything on your todo list is too taxing, itd be a good idea to reach out to your team. There's no shame in asking for help, particularly in a new job. IMHO, there's nothing worse than someone who's too proud to ask for help.

4

u/bumblebritches57 Oct 07 '20 edited Oct 08 '20

My problem is diving into the codebase, I'm SUPER burned out right now because I'm trying to contribute to a complex C++ codebase, that's about a million lines of code, and it's just super confusing.

the docs don't help, the function names etc are almost entirely useless beacuse they're so vague, like "getSize" when size could mean literally 5 different things, AND the functions are all overloaded from other dependent, ancestor, and friend classes too so it's hard to even tell which version is being called.

How do you deal with this? I prefer to stick with C, but that's not really an option because it's not my codebase.

5

u/eigengrau- Oct 08 '20

One thing that helps tremendously when working with a large code base is to use a debugger (if you're not already). I set breakpoints in the general area I'm working in and once they are caught, I look at the stack trace to see how the code got there.

2

u/bumblebritches57 Oct 08 '20

I appreciate the advice, but the one million line project I'm talking about, is just a baby, the whole project it's a part of is 9 million source lines of code and compiling takes two hours for a release build, I don't even know how long it would take to compile it in debug mode.

the project btw is LLVM's Clang.

so, I've been using things like -dump-ast to try to understand which parts of my example code are interacting with which parts of the project code, but to do a full debug build, I honestly don't know if my computer is even capable of that, and it's got 8 cores and 16GBs of RAM.

3

u/eigengrau- Oct 08 '20

Oh ok, well in that case another thing that can be really helpful is quitting. Just kidding. That sounds really painful but also interesting. Thanks for mentioning the project, I was wondering what it was.

1

u/stratocastom Oct 07 '20

Yeah that's a tough one 😩 Reaching out to other coders on the project can help, particularly if it's a messy codebase. If you're lucky, the others will sympathise and give you some pointers. Otherwise, lots of trial and error and diving down rabbit holes is the only way. At least if you think that every new method you understand will take you a tiny bit closer.

One piece of advice is to not try and fix everything - sometimes as a new coder on a project you'll want revolutionise things and leave the code better than you found it. While admirable, it'll usually just leave you in a HUGE mess and probably more demotivated than before. I've been in that situation many times 😂

Keep at it, you'll start to pick bits up and things will get easier!

3

u/_0tonin_ Oct 08 '20

This is really true, I received a piece of code last week that I had to integrate to the main software system. It was a mess, I really didn't understand what the guy was doing, lost so much time and energy in trying to get it. Sometimes you don't need to "get it" you just need the output and then work with it. Will it look better if I did changes here and there ? Yes, but his code is none of my business.

0

u/[deleted] Oct 07 '20

[deleted]

2

u/WishfulLearning Oct 07 '20

Is it normal to take these kind of breaks?

0

u/[deleted] Oct 07 '20

[deleted]

1

u/WishfulLearning Oct 08 '20

Ohh okay. I thought you meant take a 15-20 minute break during work hours.

2

u/smackson Oct 08 '20

People need to better understand the ins and outs of mentally taxing work and better respect the brain-providers.

Yes! I'll take that 20 minute break, dear manager, and if it's a tough problem, I'll take several per day. If there are sufficiently menial tasks to do, they may play a part in my necessary breaks... But when I wake up tomorrow after sleeping on it and the solution comes to me in the shower, I won't bill you for the extra time or the extra space taken up in my head.

That's The Deal

1

u/WishfulLearning Oct 08 '20

Interesting! Thanks for your reply, I hope to one day work in the industry and comments like this help me understand what the work environment is like.

1

u/stratocastom Oct 08 '20

I would also suggest against youtube (and anything involving a screen), to make sure your eyes get a rest too!

21

u/[deleted] Oct 07 '20

Yeah. Programmers only work like, 2 hours a day. Actual problem solving abstract thinking isn't a thing that happens 8 hours a day on command as much as the suits want you to think.

10

u/[deleted] Oct 07 '20

I'm glad I'm not the only one then, I feel bad if I should be working 8 hours be realistically I'm coding for maybe 2-3 hours

7

u/flagbearer223 Oct 07 '20

Nope. The 40 hour work week was not created with computer programming in mind. Why 8 hours? Why not 7? Or 10? It's an arbitrary number. As long as you're pulling your weight on your team, they won't care if you are taking 8 hours to do it or 4 hours. Just do your work to the best of your ability and don't feel pressure to push yourself beyond that. Burnout is a very real thing, and a dev that takes care of themself is going to be more productive over the course of a year than one that gets burnt out in 6 months.

The best work I've done in my entire career was during the summer of this pandemic, when I was starting work at 7, ending at 3, and working anywhere between 2 & 10 hours (depending on how I was feeling and what I was working on. Average of around 3 - 4 total hours).

3

u/Fuzzietomato Oct 08 '20

Unless you work at a place that tracks your hours like an agency, then you work 4 hours + meetings and a little finessing if the timesheets

2

u/[deleted] Oct 07 '20

So you are saying that most of the work a programmer does, is trying to find a solution to a problem, and not actually solving the problem? I am a student and have been wondering about this for a while. When I write code, most of the time is used thinking about possible solutions. I thought that programmers worked much more than this. This is reassuring to me.

5

u/[deleted] Oct 07 '20

We're knowledge workers. Most of my best problem solving comes far away from a computer just sitting around thinking.

13

u/[deleted] Oct 07 '20

It's pretty common.

https://www.joelonsoftware.com/2002/01/06/fire-and-motion/

"Sometimes I just can’t get anything done.

Sure, I come into the office, putter around, check my email every ten seconds, read the web, even do a few brainless tasks like paying the American Express bill. But getting back into the flow of writing code just doesn’t happen.

These bouts of unproductiveness usually last for a day or two. But there have been times in my career as a developer when I went for weeks at a time without being able to get anything done. As they say, I’m not in flow. I’m not in the zone. I’m not anywhere."

"What drives me crazy is that ever since my first job I’ve realized that as a developer, I usually average about two or three hours a day of productive coding."

This is from Joel Spolsky who is by all accounts a successful software engineer. I relate with that article a lot, and I've heard similar things from some of the most brilliant programmers I know.

It's not just programming, every job where you do creative mental work is hard. In grad school (in environmental sciences, not software), my thesis advisor, who was widely considered the most productive faculty member in my department, told me that excluding busywork like e-mail etc. he did about 4 hours of real work per day.

There's probably *some* people who can consistently hammer out 8 hours of code a day, but I think they are not the norm.

1

u/[deleted] Oct 07 '20

I'm really glad I'm not the only one. Problem is, my job consists of me actually getting tasks done. I work as a contractor, and given a max amount of hours for each task. After time take that much time to do it, I don't paid. So it makes me feel worse when not being productive

1

u/smackson Oct 08 '20

Yeah, that is a serious problem with the way your pay-vs-time is set up.

Ideally, a hired programmer is given tasks to do, and also given a lot of say in how long the tasks take. Experienced managers can try to estimate the time required but it should be possible for you to push back even at the end, and say "well, it didn't take a day, it took four".

And it's like a dance, where mangers get their expectations adjusted, and may eventually glean that one of their programmers is slower (and work with that programmer on improvements), while programmers learn to estimate better.

That's why salaried jobs are a better fit in my opinion. It's really in the everyone's interests to have "knowledge workers on the job, over an extended period" as opposed to "this product needs to be made in x hundred hours".

In a contract situation, if the specific things take longer and you literally work without pay, that is abuse.

However, even salaried jobs with looser time constraints (where you can switch tasks without writing down exactly how many minutes your brain is focused on which things) can become abusive. Like I said, it's a dance, and you get to take breaks and they get to have solutions you thought of in the shower in your "off" hours... Sometimes you have relaxed weeks, sometimes you work a weekend, but if you find yourself working many weekends on that base salary, something is broken.

8

u/[deleted] Oct 07 '20

Why do you think you lose motivation?

Personally, I enjoy problem solving and creativity, and the main reason for losing interest for me is if my creativity is restricted.

5

u/[deleted] Oct 07 '20

I do really enjoy the problem solving and thinking it through, but some times it gets really rough. I get really frustrated I’ve stuck on it for a long while and I lose that motivation

4

u/[deleted] Oct 07 '20

In that case going for a walk and temporarily taking your mind away from computer is exactly what you need. When you open yourself up, sometimes the solution will just come to you. When you return to your desk, you will come with a different mind. A tip for the walk: don't distract yourself with phones and such during your walk - just try to be present in the moment and enjoy it.

2

u/[deleted] Oct 07 '20

Thanks! Just went for a run, gonna hop back onto my coding again and see how it goes

1

u/my_name_is_pizza Oct 07 '20

Yup, agree 100%. Since the pandemic and working from home full time I'm actually more productive because I can do this whenever I need and not feel weird about being away from my desk.

10

u/bakedsnowman Oct 07 '20

I think a lot of people in the programming space share that passion, but patching a piece of shit legacy application can only allow for so much creativity. You're mostly just fixing the "creativity" of the engineers that came before you.

3

u/K000PA Oct 08 '20

I don’t program professionally yet as I’m still in school but I definitely experience this mental exhaustion which I have had seem to last days after solving a problem I find really difficult.

Interestingly, in school I do a lot of maths problems that I would rank in similar difficulty to my programs but don’t experience the same level of mental exhaustion from these. It seems this is a unique thing to programming although I still find it enjoyable and highly rewarding.

3

u/[deleted] Oct 08 '20

I agree with you! Was an EE major, and the mental exhaustion was definitely different. But that feeling of figuring it out when coding is so rewarding

34

u/williamf03 Oct 07 '20

I'm a veteran programmer and I have spent the better past of the last 10 years of may career fighting exhaustion and fatigue. Mental fatigue is no joke, your mind is like every other part of your body you need to work it to get strong, but it only gets stronger during rest periods.

Make sure you're resting well. Good sleep is important, but also make sure your not spending all day programming and then coming home to play computer games and or focus on your computer in your down time. You to let your mind take a break.

Another thing that's super important to help focus your mind and build endurance for your thoughts. Physical excersise. go to the gym a few times a week and you notice a huge improvement in your cognitive ability and your ability to focus on work for long periods of time

7

u/[deleted] Oct 07 '20

Agree with this so much. The combo of focusing on my sleep schedule and picking up running has made me a better programmer.

3

u/williamf03 Oct 07 '20

At the start of the whole covid lockdown all the gyms shutdown. I was working from home, no excersise, only my computer for both entertainment and work. Started eating junk and drinking more beer. I didn't even notice how much stupider that made me. But I became sluggish and apathetic. I couldn't focus on a task for more than a hour at a stretch. I felt "normal" just things were hard. I felt like there was always an external excuse to my problems.

Gyms opened back up and within one week it was like I gain back 20 iq points. My motivation came back, work became easy again. It was such a sharp and noticible change. It was so obvious that I was slipping into a depression without exercise.

13

u/EvilGambit Oct 07 '20

No joke. For me it eithers works Pomodoro style or 8 hour straight no breaks.

But that's prob cuz I have ADHD so Idk how that would work for a regular person.

In any case I only get tired if the work is boring. Or I am doing 10/11 hours trying to meet a deadline.

3

u/_0tonin_ Oct 08 '20

How long are your Pomodoro intervals? I also have ADHD and Pomodoro didn't really work for me.

4

u/EvilGambit Oct 08 '20

10 minutes. It's a lot but it worked for me. Also try to use an app it makes using the technique a lot easier. But again it's an alternative. The best strategy is to take away all distractions and dive deep into the work. That's how the ADHD brain works. All-In + consequences or no works (at least useful work) gets done. For instance I don't watch or do anything 30 minutes before i start my work so I don't get stimulated by something else. I know everybody is different but that's the gist of it.

6

u/[deleted] Oct 07 '20

Sometimes. Especially right now. I've spent the entire day troubleshooting, and not just one thing. I have to keep switching back to Reddit (or something else) every hour or so to give my brain a break. It actually helps.

6

u/lead_alloy_astray Oct 08 '20

I’m usually burned out by lunch unless there is something really stimulating about what I’m working on.

5

u/[deleted] Oct 07 '20

Same thing happened to me, and honestly, I just asked for help from one of my senior coworkers, he helped me work through a block I had for weeks and my motivation came back full swing.

2

u/my_name_is_pizza Oct 07 '20

Also, it's way better for everyone on the team if you to ask a colleague to talk through a problem with you than to spin your wheels for days.

4

u/toepicksaremyfriend Oct 07 '20

Yep, totally normal. My brain hits a point where it just feels fuzzy and doesn’t want to deal with heavy amounts of code. I try to avoid getting to that point by taking breaks - answer the deluge of emails, switch to a different coding task, whatever.

4

u/my_name_is_pizza Oct 07 '20
  • answer the deluge of emails, switch to a different coding task, whatever.

Those don't sound like breaks.

4

u/CunningFatalist Oct 08 '20

Other people already posted what you can do about it (exercise, drink a lot of water, sleep, have none-computer hobbies). I would like to add to this list. If you are wearing glasses, like me, getting some with a filter for blue light can really make a difference. Ask your optician about it.

3

u/[deleted] Oct 08 '20

Yes.

3

u/[deleted] Oct 08 '20

Same here. You are definitely not alone. I'm happy to have come across this post because I typically wonder this myself. I just started work as a full-time swe and I've encountered this many times. Being stuck on something is the worst.

3

u/stephcasa Oct 08 '20

This thread is so wholesome and is why I love programming and programmers.

0

u/bakedsnowman Oct 07 '20

Pro Tip: Adderall and Caffeine.

3

u/Icanteven______ Oct 07 '20

It leads to burnout though. My startup was basically built on adderall but my mind was fried afterwards for like 2 years.

1

u/[deleted] Oct 07 '20

I could def imagine

2

u/[deleted] Oct 07 '20

I wish I had the connections now, I’ve used it before in college. Def helps

2

u/TerminatedProccess Oct 08 '20

Get lots of sleep, exercise, eat a low to medium carb diet, be well hydrated.. My experience is that when you never exercise, wake up frequently at night and can't go back to sleep, eatc heavy meals with poor nutrition.. well the brain can't keep up.. it does matter..

Edit.. also look at other factors.. are you diabetic? Pre diabetic? Eyes having issues?

1

u/kepper Oct 08 '20

I've found pomodoro tools to be of great help. My favourite is a plugin called Block and Focus, which I use mostly to block reddit for 20 minutes at a time, then unblock it for 5 minutes.

Most of the time when the 20 minutes is done, i'm into what i'm doing and just keep working. If I'm tired, reddit is unblocked and its time for a break!

The structure is helpful.

1

u/jffryteo Oct 08 '20

I’m glad i’m not the only one, graduating next year and i’m on a internship, beating myself whenever i get stuck and can’t move on. Hang in there frans

1

u/oparisy Oct 08 '20

Is your sleeping pattern decent? Do you get enough rest at night?

1

u/[deleted] Oct 08 '20

No, and is because each hour of work I take 10 minutes to rest, read a little, go for water or for a walk.

1

u/hamburglin Oct 24 '20

Sounds like your not using your brain as efficiently as you could. Buy a whiteboard asap and draw out the more complex problems instead of trying to fit it into our hunan's limited working memory/cache. Use disk space more.