language-agnostichandwriting

How to efficiently write code on paper


In my University tests I often have to write programs and algorithms with pen and paper. For example, for my next test I'm going to have to write quite a lot of code in scheme and Java on paper.

I write quite a lot of code, but never on pen and paper. When writing code on paper, I often go at it with the same attitude as if I'd be writing the code on a computer. This often results in a lot of strikethroughs and additions, which often results in a total incomprehensible mess, because I'm used to being able to add and remove blocks as I please.

The problem is the programs or algorithms are complex enough so that it's not possible to think them completely through in your head before writing the code.

Is there any way to effectively and efficiently write code with pen and paper?


Solution

  • You are right in writing the code on paper as you write it on the system. But, to write an efficient code, you need to learn few things

    1. Always use indentation at every line of code to make it presentable
    2. Don't forget to add comments at various points so that what you are writing and trying to convey gets clear to the examiner
    3. If anywhere you want to cut through some parts of your code, or encounter a strikethrough, better strike out the whole line and rewrite it. It improves the visibility of the code and makes it appealing.
    4. Remember to leave ample amount of space between two lines of codes, probably a blank line or two. This spacing makes your code presentable.

    More suggestions are welcome.