{
The following is C convention. Use it!
Every compound statement, i.e. a set of statements enclosed by { and } (analogous to begin/end in Pascal) should be indented further to the right than its ``parent'' statement (the latter being one of if, else, for or while). The { and } are arranged in a ``triangular'' form. E.g. for a while loop:
while (...) { statement statement statement ... }
This is used in the same way for for loops and if-then-else:
for (...; ...; ...) { statement statement statement ... }
if (...) { statement statement statement ... } else { statement statement statement ... }
For example, if I have a rather long while loop, someone who reads my program should be able to easily find the end of the loop, simply by going straight down from the `w' in `while'.
Every major variable declaration should have a comment explaining what that variable does. Most functions should have comments at the beginning, explaining what the functions do.
Employ these devices--top-down style, indenting and comments--in all your programs, from the moment you start writing them, not just when you are done writing! You will save yourself a lot of time, both in writing and in debugging. Use of top-down style is especially important. It will help your thinking process tremendously during the time you are writing the program. You may have been told in the past that this is to help other people, i.e. to help other people read your program; that is true, but it is also to help yourself! It will save you time!
Make full use of X11 windows if you at a workstation console; otherwise use the `screen' program to get windows. And in either case, use emacs, with its nice windowing features; e.g. when editing a program file and adding a call to a given function, you can have one window at the call and another window at the function, so that you can check that the parameters match up correctly.
If you are using top-down design, comments and windowing properly, you should not need to use any paper: