“The purpose of computing is not numbers. The purpose of computing is understanding.”
1. Write programs that are clear to both the reader and the compiler.
The first and foremost general principle of programming is clarity. From clarity comes the ability to test, to reuse, and to audit. One simple test is whether you believe you will be able to understand the code if you come back to it a year later.
Of course, you write programs to have the computer calculate something for you. And you know that the computer must be told exactly what to compute. Your program must completely and correctly specify what is to be computed.
If you are making a numerical calculation, you likely have some consideration for the efficiency ...