Perhaps it's all about context in terms of how you view how salient the negative feedback is. I can only speak of my experiences but I always found that no matter how frustrated I get while coding, the moment that everything finally functions releases such a dopamine rush that I quickly forget about the frustration.
Perhaps two things (probably more) are necessary in order to overcome this negative feedback loop:
Learning how to let go of failures.
Focus on the euphoria of fixing a bug.
Remember that as humans we essentially are very complex machines and perspectives partly determines how we will react to a stimuli.
Learning how to let go of failures. Focus on the euphoria of fixing a bug.
Remember that as humans we essentially are very complex machines and perspectives partly determines how we will react to a stimuli.