I was like this when I started programming. I thought it was just a chore that had to be done so I could get on with the fun stuff of making a game. Hell, I even took it to the point of forcing myself to make games I had no interest in and spent months 'not getting it'! My greatest nemesis was Tetris; damn those accursed coloured blocks and their logic!*
After a while, and after multiple stupid beginner tactics (including changing languages on a regular basis), I eventually, and
finally, got it! The "it" behind why I couldn't enjoy programming; it was for two reasons - first and foremost: because I could never focus on what I
wanted to do but instead focused way too much on what I 'had to' do!
Second: I realized that it was hard to enjoy the journey when I was so focused on getting to the destination. While I was so focused on getting games made it became that much harder to not getting agitated when the learning process got in the way. There was also a third, minor, reason that also was quite frustrating: the amount of structure in the learning process; there was far too little freedom in just doing whatever I wanted and far too much focused on stuff I 'had to' learn for making a game.
The solutions were rather simple.
First, I stopped working on
any project which didn't interest me. This was an instant helper. Of course, I
thought this was going to slow down my learning quite a bit, so I had to identify projects on every step of road that I wanted to make - from the really simple games to the super-complex. After a while, I was getting back on track and learning not only
more but also
faster and I had a lot more fun - I realized, above all,
motivation is key! The second issue was hard, it's never easy to put things on hold when you know that might spell doom for your dreams. Eventually though, while working so hard to get to the "fun part" (hah!), I realized that it was actually way too much fun doing what I already was doing. I attribute this to point three; I had started a lot more hacking stuff together instead of neatly structuring. For sure, the results were often horrible code-wise, but I got visible progress way faster and programming started becoming fun for real.
Later on, when the "beginner stress" had settled down, I went back and re-learnt many of those 'proper' programming methodologies. To this day I still don't consider myself properly reared in programming though; maybe one day in the future I'll get there
TL;DR: don't stress things, you'll get where you want eventually. Choose fun projects and have fun tinkering with them. Find your niche in programming, whatever that may be. Learn the way you want to learn, don't let any structured old geezer tell you otherwise.
Best of luck!
* I feel I should mention, I could actually make a fairly complex 2d game at this point; I made a complete 2d top-down shooter with levels and everything. But
STILL I couldn't beast Tetris - something with my brain and grids didn't quite fit back then