Now, let us see "What are the tips to design a good program?"
Although the program design involves several stages, the following are the few important tips to design a good program:
I Tip: Make a program readable. It is a combination of the following:
II Tip: Stepwise refinement of a solution
III Tip: Avoid 'goto' statement to jump around, forward and backward, into and out of loops or blocks of statements. The blocks are also called compound statements.
Although the program design involves several stages, the following are the few important tips to design a good program:
I Tip: Make a program readable. It is a combination of the following:
- Careful choice of data structure or data type.
- Careful choice of variable names.
- Generous use of remarks or comments.
- Program indentation.
- General program design
II Tip: Stepwise refinement of a solution
- Break a problem into a sequence of relatively self-contained or independent sub-problems.
- Follow orderly flow of stepwise refinement.
III Tip: Avoid 'goto' statement to jump around, forward and backward, into and out of loops or blocks of statements. The blocks are also called compound statements.
- The programs using 'goto' are difficult to read and debug.
- The programs using 'goto' are called unstructured programs. Always hate such unstructured programs.