I personally feel if you want to understand programming language, you have to learn the concepts using any good text or having guidance from someone, then collect code segments written by other programmers and understand those segments using dry run (extract output on paper for each step considering yourself a compiler) after that try the program by yourself compile and run it and be confident that output would be same as you have at your paper using dry run. Now try to write same program by yourself without looking at it, also try new approach to write the same program.
After having some practice...