1. Define the Problem Completely
2. Think First, Program Later
3. Use the Top-Down Approach
4. Beware of Other Approaches
5. Construct the Program in Logical Units
6. Use Procedures
7. Avoid Unnecessary GOTO's
8. Avoid Side Effects
9. Get the Syntax Correct Now, Not Later
10. Use Good Mnemonic Names
11. Use Intermediate Variables Properly
12. Leave Loop Variables Alone
13. Do Not Recompute Constants within a Loop
14. Avoid Implementation-Dependent Features
15. Avoid Tricks
16. Build in Debugging Techniques
17. Never Assume the Computer Assumes Anything
18. Use Comments
19. Prettyprint
20. Provide Good Documentation
21. Hand-Check the Program Before Running It
22. Get the Program Correct Before Trying to Produce Good Output
23. When the Program Is Correct, Produce Good Output
24. Reread the Manual
25. Consider Another Language
26. Don't Be Afraid to Start Over
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
These days (the original is from a while ago, 1975) if you do these..
Quote:
6. Use [methods of putting the processing of on aspect in a seperately defined place]
7. Avoid Unnecessary GOTO's
10. Use [meaningful] Names
19. Prettyprint
20. Provide Good Documentation
What is left to go in here in a Cobol program?
Quote:
18. Use Comments
I'm not being critical of the original, as they were written for FORTRAN which then (I don't know, but maybe still) had much more limited possibilities to give meaningful names due to the length of datanames and the use of numbers as labels.
In the "exotic" "SORT card" "programs", I'd personally like to see every single line commented for production work.
These I'd recommend to all who don't yet do this automatically (even 21 becomes a concurrent process, second-nature, while thinking, reading the spec, writing code, taking a... coffee).
Quote:
1. Define the Problem Completely
2. Think First, Program Later
5. Construct the [solution] in Logical Units
21. Hand-Check the Program Before Running It
These ones are a bit specific to the original development environment.
Quote:
8. Avoid Side Effects
9. Get the Syntax Correct Now, Not Later
11. Use Intermediate Variables Properly
12. Leave Loop Variables Alone
13. Do Not Recompute Constants within a Loop
14. Avoid Implementation-Dependent Features
15. Avoid Tricks
16. Build in Debugging Techniques
Avoid Tricks is good advice for day-to-day programming.