DEV Community


Posted on

How to stay motivated as a developer while struggling with a single error for hours?

You've probably been in such kind of situation, how did you overcome?

Discussion (3)

yerac profile image
Rich • Edited
  • Walk away. Get away from your desk and do something completely unrelated to programming. If i am in the office I will go for a walk around the building, or go grab a coffee from the furthest point away. Too long on the same issue and you go "code-blind".

  • Rubber Duck time! Grab a collegue, friend or inanimate object and describe the issue you are having in detail, what you are trying to overcome and what you have tried and why that didn't work. Just talking out loud will sometimes cause things to just "click".

And in terms of technical resolution, document all the steps you have taken and ask someone for their opinion, or break the problem down into smaller chunks and tackle them one at a time instead of going for a full-fix.

And if it makes you feel better, I once spent 2 weeks solid debugging a complex system, can be very disheartening but when it works, it feels great and you will have a better understanding of part of the system you never knew about!

andreasjakof profile image
Andreas Jakof

What he said!

I am tending to put my heels into the ground and keep on looking for the bug.
But more than not it helped, to just get a bit distance or to talk to someone about it.

And : a good night‘s sleep will do wonders!

rohullahayobi profile image
R.A. Author • Edited

Yes, Rubber Duck! it's magical!
Appreciate your answer Rich :)