Dunno, maybe it's some old-school thing from the days of punch cards?
My first programming teacher was back in HS, some 25 years ago. The man was a retired software engineer in his 60s. He really pushed that train of thought - to "finish" the code in your mind, on paper, etc. before actually writing it and hitting compile / run.
I never took it literally in the sense that you need to think out the entire program, but rather that when writing functions and more overall logic, it is good practice to have it all worked out - rather than just write as you go, and iterate. The latter part is very easy to do these days, as running code is more or less instant...
The edit-compile-test cycle in 1986 on a large mainframe was approximately 6 hours. A laser printer cut that down to 3.5 hours and that was enough to be able to do twice as much in a day. You can't imagine how surreal the difference was between my productivity at home on my micro computer vs what I got paid for.
The only way to get anything done at all was to have the program more or less complete in your head otherwise you'd be busy for months on a simple problem. Exploratory programming? Forget about it...
My first programming teacher was back in HS, some 25 years ago. The man was a retired software engineer in his 60s. He really pushed that train of thought - to "finish" the code in your mind, on paper, etc. before actually writing it and hitting compile / run.
I never took it literally in the sense that you need to think out the entire program, but rather that when writing functions and more overall logic, it is good practice to have it all worked out - rather than just write as you go, and iterate. The latter part is very easy to do these days, as running code is more or less instant...