I think the best way to get better at programming is to
- Write programs that you actually want to make
- Whenever you run into a hard part, first try to do it yourself
- Once you succeed or fail, research the problem and see how others solved it
- Always look up words/concepts you don't understand while researching and don't stop until you understand
- Repeat
If you like, you can also just read some books or scour some programming related communities for general info, without some specific goal. However, most people don't have the motivation to do that, because they don't know what that information is good for yet. That's why, for most people in my opinion, it's better to just try to do something and then learn (better) ways of doing what you want, because then you actually immediately get what it's good for and why you'd need it.