"In order to arrive at what you do not know You must go by a way which is the way of ignorance."
I came to CS and programming only after a degree in the humanities so every time I learned something new I felt incredibly stupid. I would read books very slowly and carefully, re-reading any tricky parts, and never assuming my prior knowledge in an area was at all relevant to what I was learning. But after every book I read, or topic I learned my mind and understanding of the world really felt expanded.
After a while I started to gain confidence, and the perhaps a bit more than confidence. I remember being proud the first time I opened a technical book and thought "pssh I know most of this already this will be a quick read". But I quickly discovered that whenever I approached a topic this way I only left with a shallow change in my understanding. In fact I realized that I was shaping this new material to what I already new rather than expanding my existing assumptions. I was essentially wasting my time, reinforcing my ego but not really learning much.
So whenever I meet someone who is learning something new and they're angry with themselves for how 'stupid' they are, I remind them that this is actually the peak of learning. And likewise whenever I open a book, even if it's in familiar territory I try to put myself in that mind set of ignorance. It's a pity we, especially in technical fields, associate so much shame with ignorance, when this is a feeling that we should aim for when we sit down to learn.
For anyone familiar with Zen Buddhism you'll probably recognize this idea as a variant on Shoshin or "beginner's mind"