Back when I was coming up in university back in the mid-seventies, I acquired a book called Programming Proverbs for Fortran Programmers which at the time was the language I was learning as a young EE student. (The switch to software engineering was a couple years out.) The book turned out to be the seminal work in my learning about software development, though I probably didn’t realize it at the time.
Today, the books lists for a cool $85 on Amazon in its original paperback form. The more generic version, just Programming Proverbs, can be had for pennies, apparently, and is really worth having around. It uses languages like PL/1, Algol and a few others. Nearly all structured C-based programming languages are based originally upon Algol.
But the fact it uses archaic languages is not a detraction. The strength lies in proverbs themselves. Though a few might be considered implementation specific or truly anachronistic (#21 in particular will have most of you laughing, I am sure), they all lend themselves quite well to the modern programmer.
(On that #21: spending time looking over what you’ve written before just blasting it through the interpretter can save some time for the silly mistakes the syntax checker won’t find. With rails startup times, a mistake in the run time that you should have caught by looking is just downright frustrating.)
I’m giving just the list of the proverbs here, with the hope of providing a series expanding on a few of these.
Programming Proverbs, Principles of Good Programming with Numerous Examples to Improve Programming Style and Proficiency
- Define the problem completely.
- Think first, program later.
- Use the top-down approach.
- Beware of other approaches.
- Construct the program in logical units.
- Use procedures.
- Avoid unnecessary GOTO’s.
- Avoid side effects.
- Get the syntax correct now, not later.
- Use good mnemonic names.
- Use intermediate variables properly.
- Leave loop variables alone.
- Do not recompute constants within a loop.
- Avoid implementation-dependent features.
- Avoid tricks.
- Build in debugging techniques.
- Never assume the computer assumes anything.
- Use comments.
- Provide good documentation.
- Hand-check the program before running it.
- Get the program correct before trying to produce good output.
- When the program is correct, produce good output.
- Reread the manual.
- Consider another language.
- Don’t be afraid to start over.