I am reading a book on 2D game programming, and I can't remember much of the code, although I understand how it works and am able to do some simple modifications, though I'm stuck on one, probably a bit more advanced one now.

I am wondering how usually the process of learning a programming language goes - is it okay if I don't remember most of the code and just understand the way it works. I'm not really good with memorizing "static" things usually - for example at school I always can retell a text from two A4 pages by reading it once for an A or A+, but I can't recall mathematical formulas by reading them 20 times. Same goes for the code.

As for my current knowledge (if that matters) - I know the basics of C++, a bit of C and learning Win32 basics from a book about game programming. My ultimate goal is to create some nice little games (I have a lot of ideas in my mind) that people could enjoy. Although I'm a bit afraid of graphics design at the moment, but for now - I want to learn the code.