The program representation refers to its presentation style so that the program becomes more readable and presentable.
The guidelines to develop a good program are
Ensure clarity of expressions
Use comments and indentation
Expressions carry out the specified actions. Thus they must be clearly understood by the users. There should not be any compromise with the clarity of expressions.
never sacrifice clarity of expressions even if changed expressions may get you minor gain in machine execution time
use standard functions in expressions to enhance readability
Comments provide internal documentation of a program. Indentation makes the statements clear and readable.
The insertion of blank lines and blank spaces at appropriate spaces also enhance the program readability. The blank lines are separate declaration blocks, comment boxes, procedures and functions etc.
When program formatting is done to make a program more readable, it is called pretty printing.
The characteristics of a good program are
User friendly: The program should be user friendly
Self documenting code: A good program must have self documenting code. The source code that uses meaningful names for constant, variable and subprogram identifies to clarify their meaning in the program.
The various stages of program development process are
code the algorithms
compile the programs
execute the programs
The code which can handle exceptional data errors and operational error is called guard code.
Errors that occur during compile time are compiling time errors. When a program compiles, its source code is checked for whether it follows the programming languages rules or not. Two type of errors fall into category of compile time errors. They are syntax error and semantics errors.
Error that occurs during the execution of a program is run-time errors. These are harder to detect errors. Some run-time errors stop the execution of the program which is then called program crashed or abnormal terminations.
The steps for creating a program are
understand the problem well
analyze the problem
design the program
code the program
test and debug the program
complete the documentation
maintain the program.
Documentation refers to written descriptions, specifications design, code and comment, internal and external program, which make a program more understandable, readable and more easily modifiable.
A user documentation should provide the following information like
a. general descriptions
b. run flow and descriptions
c. logic flow
d. program testing
e. file descriptions
f. record layouts
g. output specifications
h. file disposal
i. error messages
j. special run instructions
k. security considerations
l. restart and recovery procedures
Uses of documentations
useful for technical personnel not only during development, but also during operation and normal maintenance.
Essential during abnormal termination.
Very helpful in initiating and training.