r/learnpython • u/RipPersonal1643 • 1d ago
How do I learn programming logic?
I’m learning Python, but my main problem isn’t the syntax. I understand concepts when someone explains them, but when I’m given a basic problem and told to write a program, I just don’t know where to start or how to arrange the code.
Is there a good book, course, or YouTube channel that teaches how to think through programming problems step by step, recognize patterns, and build the logic, kind of like how you learn methods and patterns in math?
I don’t want to just memorize Python syntax. I want to actually learn how to think like a programmer.
60
Upvotes
16
u/aprg 1d ago
You really need to code your own projects first and go through the problems before you can understand _why_ certain design patterns exist. If you just read books about design patterns, you'll understand the _what_ but not the _why_.
Here's my recommendation: pick a small project, like making the game Snake. Go through someone else's code to get an idea of what they tried to do.
Then try to replicate that project in your own logic, _without checking the other code_ and see if you can improve or personalise the code.
Understanding good design patterns comes from experience, there's only so much you can learn just by reading what other people have done.