r/learnprogramming • • Mar 07 '23

Is it normal as a junior programmer..

To spend hours looking over the same block of code, trying to sort out ‘why the f*ck isn’t this working!?’, only to realize the error you made is so monumentally, and stupidly obvious that it leaves you feeling like a completely useless moron? Lol

1.6k Upvotes

297 comments sorted by

View all comments

Show parent comments

4

u/codetrasher Mar 08 '23

I was going to suggest naps, as well. Mainly because fairly recently I was able to solve and refactor a logic bug with Angular/TypeScript code I had written a couple of months earlier. I knew the code structure sucked back then but it solved the issue I was having at the time so I committed and pushed it, but it came back to bite my ass a couple of weeks ago when a user reported a bug. I'm working from home and that day the kid was at home with flu, and usually on weekends and cases like this we take a nap or at least rest a while. That day I actually fell asleep for a moment as I was more tired than usual, and after waking up somehow the solution for my code problem came as clear as the day was, so I took notes of what I needed to do and started working. I was able to clean up the code tremendously with fewer if-elses and it solved the new bug, too.

I have plenty of other examples to share about the importance of taking breaks, naps or walks during (mental) work like programming. Bashing your head against the problem won't make you come up with the solution any quicker but taking your mind off of the problem actually could, more often than not.

4

u/OrganicPancakeSauce Mar 08 '23

It truly is one of the beauties of WFH - as long as the work gets done, nobody complains. I think proper documentation is also super crucial to a situation like yours. But that’s even harder when you already have no idea what’s going on because the person before you (usually yourself, I know it’s always myself) doesn’t document a quick thing.