Something that early programmers did not fully appreciate is that programs tend to take on a life of their own, being reused and modified over a period of years, often by people other than their original authors. The better a job the original author did of documenting the program and writing it clearly, the easier it will be to reuse and modify.
By ``documentation'' I mean comments at the start of the program that help potential users understand exactly what the program does without necessarily understanding how and definitely without reading the whole program. Generally speaking, these comments should describe the program's inputs (command-line arguments, file input, input from standard input) and outputs (file output, output to standard output) and how they are related.
The object of these suggestions is to make the code clear and readable for the human reader, perhaps a programmer who wants to reuse it with modifications. Here are some tips for writing clear code.
//declare the variables
is useful only in example programs for beginners; after your first few programs you shouldn't need such a comment. Also, comments that just echo what the code is doing -- for example,
count++; // increment count
-- are not helpful (again except in example programs for beginners).