Programming Methodology - Ayush Computer Technology

Programming Methodology

Stylistic Guidelines:

Writing good program is a skill. This can be developed by using the following guidelines.


1. Meaningful Name for identifiers: A programmer to give the meaningful names to each section of the program so that it can help him to identify the variable used for specific purpose. This helps him to execute the right elements during the complex run of a program.

2. Ensure clarity of expression: Expression carry out the specified action. Thus they must be clearly understood by the users. There should not be any compromise with the clarity of expression.

3. Use of comments and indentations: Comments generally are used as the internal documentation of a program . if comments are used in the program they will guide the program while debugging and checking. While indentation is the proper way of writing to avoid the confusion regarding the flow of program. These highlights nesting of groups of control statements. 

4. Insert blank lines and blank spaces: Blank lines should be used to separate long, logically related blocks of code. Specifically Normally in programming the standard for the use of spaces is to follow normal English rules. This means that: Most basic symbols in C++ (e.g., “=”, “+”, etc.) should have at least one space before and one space after them. 

5. Statements: Each statement should appear on a separate line. The opening brace following a control statement such as if or while should appear on the line after the if or while, lined up with the left of the control statement, and the closing brace should appear on its own line, lined up with the left of the control statement. As an example, see the for loop in Figure 1. The opening and closing braces for a function should be lined up in the same way. The statements within a {_____} pair are indented relative to the braces. 

Characteristics of a Good Program: 


Following are the characteristics of a good program. 

1) Effective and efficient: The program produces correct results and is faster, taking into account the memory constraints. 



2) User friendly: The program should be user friendly. the user should not be confused during the program execution . The user should get correct direction and alerts when he is going through the program.


3) Self documenting code:  A good program must have self documenting code. This code will help the programmer to identify the part of the source code and clarify their meaning in the program.



4) Reliable: The good program should be able to cope up from any unexpected situations like wrong data or no data. 


5) Portable: The program should be able to run on any platform, this property eases the use of program in different situations. 

 

No comments:

Post a Comment

Pages