in reply to How to write programs?
I doubt there is a single methodology which will work well for most people. I usually walk around for several days thinking about a project till I am really "zoned out" on the ideas. Then I start writing; that works well for me. Even so, I don't usually write linearly - rather I implement some main pieces, make sure those work and then add parts, etc. (For example, I once wrote code to emulate a programmable calculator I had; first I implemented a stack and the functions to print it to the screen and read input; then I implemented a few operations and kept adding those over a few days. Finally, I worked on the programmability.) If something doesn't work as expected, I debug by adding print statements, but usually I'm so clear on what I want to do that I don't have to debug too much.
I used to write English papers by putting a sheet of paper in the typewriter (a machine most of you probably haven't heard of...they're extinct now) and typing - slowly with a lot of thought. I hate writing outlines! But clearly this wouldn't work for everyone.
Anyhow you do it, it takes a lot of concentration and effort, but if you get results I wouldn't worry much about methodology.
chas