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

3

u/Montags25 Mar 08 '23

How often should I commit? If I write a function let’s say should I commit after each one I write? I guess the more commits means less code to sift through when something goes wrong?

5

u/aaachris Mar 08 '23

Generally a good practice to commit often while it's working

1

u/dmazzoni Mar 08 '23

I try to commit every time I make something new work, so ideally most commits are not in a broken state. That should be multiple times per workday.

But, if I am going to take a break or if something is taking a while, I might commit with a comment saying it's a half finished change.