So when I made a mistake, I'd just crush myself with doubt and anxiety. It literally would hurt my brain and give me the sinking feeling that I'd never be able to do this because I can't code anything without screwing up somewhere.
But now, after about 6 years of doing it, I've developed an entirely different attitude. The correct attitude towards machines is that they do not work. They are broken by default. So if they work, something went terribly right.
Now, when I write a line of code, and it breaks, it's just business as usual.