I can relate myself to you. Not only me, but everyone at some level have felt same as you. How frustating it becomes when we are not able to understand something. For me, I have realized that we should learn to manage our expectation. We see others code and feel when I will be like them. This is not good !
We all learn at our own pace, we need to do more practice. They too have undergone same as you, but they have practiced hard to be there.
All I can say to you, no matter what other say, you believe in yourself and practice even little everyday until you become master. Invest your time in programming tutorials or books. One day you, me and other, we will succeed !