I'm curious about whether memorizing solutions after looking at them is an effective way to learn programming, specifically Python. I find it really tough to grasp concepts from textbooks or documentation. When faced with a problem, I often struggle to figure out where to start. So, what I've been doing is looking at the solution first, then trying to code it from memory. However, I've noticed that unless I tackle the same problems repeatedly, I have difficulty retaining what I've learned long term. Is this approach reasonable, or is there a better way to study and improve my skills?
6 Answers
Nope, that's not the best approach. Programming is all about problem-solving. Instead of memorizing, focus on breaking down problems into smaller pieces. It's a slow process, but learning to read and understand code will help you way more than just trying to reproduce solutions.
Skipping the struggle isn't a good idea. Figuring out how to solve problems is central to learning programming. You've got to wrestle with the concepts to really understand them!
Honestly, you won't make real progress just memorizing. Pick a structured course, whether that's a textbook or an online resource. Start from the basics, type out the example codes, and play around with them. It's essential to struggle with exercises—you'll learn much more that way!
The issue with just memorizing is that you miss out on understanding the principles behind the solutions. It's more beneficial to learn the foundational concepts and how to apply them; that's how you truly grasp programming.
Programming isn't like solving a fixed math problem; there are often many ways to tackle an issue. You need to identify what you want to achieve first, then design your program based on those requirements. Don't be afraid to develop your own style of working—find what helps you best!
Yes! A lot of competitive programmers take a break after struggling for a bit. If you can't find a solution after some time, check the answer, but spend some time understanding it and try modifying it. You learn patterns this way, and the more problems you work through, the better you'll get.

True! Everyone has their methods. Just be adaptable and keep experimenting.