Don’t plan your code when you sit in front of your computer and watch your code. At least don’t plan every line of code in front of your computer if you think you are not progressing anywhere.Sometimes it’s better to plan your coding somewhere else, like on a walk, or at shower or in the kitchen. Write down the plans when possible. When you are happy with the plan, sit down and code the planned module.
I find it useful to plan far away from the computer… and when the plan is done – I can come to the computer and work the plan. Of course there’s changes, bug fixes and new ideas that come to my mind when I code. Then I can adjust the plan, and plan the code while I’m typing. But generally speaking, if I just stare at my code and get nowhere, I usually try to step away from the computer and plan far away from computer. And after the new plan is ready… I come back and type it.
For me it suits. Feel free to try it, you might be surprised how focusing either on planning or coding makes all the difference.