PPT Slide
Programming Rules of Thumb
- Learn program schema (patterns) of general utility.
- If you know a relevant program scheme for the problem at hand, use it.
- Work the problem at hand to gain insight into its solution --think about it with respect to some particular example data and see what you think the answer would be. Ask yourself, “What am I doing?”
- Declare a variable for each piece of information (state) you keep track of while working the problem at hand.. Write a comment that describes precisely the contents of each variable.
- Remember to take care of boundary conditions
- Check your program by hand tracing it on simple test data (or trace it using the debugger).