Address Your Mindset
The answer to the following question will not only have a big impact on your level of enjoyment and happiness as a software engineer, but it will have a large influence in many aspects of your life.
How do you feel when you don’t understand something?
This seems like a simple question, but the answer is very telling. Do you tend to feel “down” or get discouraged? What if this feeling continues for days, weeks or even a year? Or do you feel curious? Are you energized?
The way that one feels when encountering things they don’t understand may be in correlation to their mindset. If you do find yourself discouraged in these types of situations, know that this is a choice you don’t have to make! If you are getting down, consider altering your mindset.
Imagine a child comes home from school with an excellent grade on their examination … what would be an appropriate response from a guardian?
What a great job! You are so intelligent and I’m proud of you!
What a great job! I’m so proud of how hard you worked to prepare for this exam. Keep up the good work!
Both responses above are positive; however, if the second of the two resonates with you more, you may already have a growth leaning mindset.
Various research has been conducted over the years on how mindset affects performance.
In the famous paper, “Praise for Intelligence Can Undermine Children’s Motivation and Performance,” Claudia M. Mueller and Carol S. Dweck conduct a series of experiments on children to explore the affect on praise for intelligence vs. praise for hard work. Some things they found it affected:
- The types of tasks they chose to work on in the future (performance optimizing vs. learning optimizing)
- The type of information they were interested in receiving after completing the task (the performance of others vs. techniques for mastery)
How they measured their intelligence based on performance (low ability vs. low effort)
These effects became apparent early in each experimental session when children were asked to choose between performance and learning goals for their future problem-solving tasks. Children praised for intelligence after success chose problems that allowed them to continue to exhibit good performance (representing a performance goal), whereas children praised for hard work chose problems that promised increased learning. 
This work and others have led to the general theory on growth mindset.
What Can We Take From This?
We should adopt a mindset of thinking that we can always expand our knowledge and use the opportunities when knowledge gaps are realized as a way to explore and learn.
Talent is a myth … rather innate expert talent is a myth. Individuals have to work very hard to be “talented”. Since this work / practice is often done in private, observers often assume the person is “just talented”.
Reasons to Address Your Mindset
Perception is very powerful, especially our self perception. The following concepts can be used to challenge our perceptions and change our mindsets.
It’s Not Always User Error
Some code may just not be well written. I have been in situations when I’ve felt self-concious for not understanding how something is working only to realize in the end that it was not well-written or designed.
It Doesn’t Look As Bad As You Think (Deal With Imposter Syndrome)
If you are in a healthy organization with good hiring processes, then there is a reason they hired you. I recently wrote the following in part 1 of How to Be Good.
When you were accepted into the new environment, you demonstrated qualities and skills that were deemed suitable to contribute to the environment’s bottom line …
You Are Learning Someone Else’s Mental Model
Be kind to yourself. It’s important to put any problem at hand in its proper perspective. When you are learning new code, what you are really doing is learning someone else’s mental model of the problem they attempted to solve. Sometimes a mental model may come easy to you. Other times it may not, be kind to yourself as you learn the model.
It’s very important to separate how you feel about yourself and life from your performance [a]. If you don’t do this, you’ll find that your mood will swing by the day or even hour depending on how quickly you are able to perform your tasks. Be kind to yourself, it’s just not a nice way to live when you make your perforamnce a reflection on yourself.
Consider adopting the the mindset that
I am going to grow no matter what.
Stick with the process … it will get better over time.
[a] I like the advice that Haverbeke gives to his readers in the introduction of his text on programming.
“It is up to you to make the necessary effort. When you are struggling to follow the book, do not jump to any conclusions about your own capabilities. You are fine—you just need to keep at it. Take a break, reread some material, and always make sure you read and understand the example programs and exercises. Learning is hard work, but everything you learn is yours and will make subsequent learning easier.” 
 Mueller, Claudia M., and Carol S. Dweck. “Praise for Intelligence Can Undermine Children’s Motivation and Performance.” Journal of Personality and Social Psychology, vol. 75, no. 1, 1998, pp. 33–52., doi:10.1037//0022-35184.108.40.206.