I often do write my code on paper, especially if it's a bit more tricky than usual. Writing code on paper seems to give me more concentration :P
Is this a good idea to write / work out code on paper before trying to type it in and compile? and does anyone else do this?
You have to keep track of why you're making the functions, where you want them emplemented, what they will be used for, what they will return, and how the return values will be used if there are any, etc... etc...
In a complex program, it can be quite difficult to do that. I tend to do it in parts, after making notes of the features in the main file about what the program will do/what features I want.
I somtimes have 4 half-written functions because I write so sequentially.
IWishIKnew I never really did either, except for one time and that project was over designed and I dropped it. I do exactly what you do now, when I write code I am always 10 steps ahead of what I'm writing at that time.
I never write actual code on paper, it feels like a waste of time to plan such low level details such as the individual lines of code. I also can't really draw curly braces, so that's also a limitation. For any non-trivial project I'll plan it out in a number of ways, depending on the project. Some notes go on paper, others in Excel sheets, wherever they fit best really. I often times come up with solutions to problems in my projects when I'm out and about, so my phone is filled with little notes that I put in so I don't forget.
Human brains are multithreaded, which is why we get sidetracked, and end of writing several different processes simultaneously. Half the time I live code when the task is trivial, the other half I think hard design in my mind or using "simple" directed graphs and code when I know my solution is close to what I want. Sometimes you got to get in and experiment, and its like art when you know the language well enough when you spend less than a millisecond thinking about the tech intracacies of it.
I don't write the original program on paper but, after I am into a program somewhat, I need a paper printout to debug and improve it.
I have about seven different coloured highlighters and use them to group if-else statements, function begin-end, dynamic memory creation-destruction, etc. I just can't work off a computer screen; I always miss a closing brace or something. Working on paper helps me be anal about everything.
I take the printout to a table away from my computer and review the code line-by-line, hand-writing comments and reminders to myself about what has to be checked or improved, etc. I find my best thinking happens away from the computer.