Coding standards?

 General coding standards refers to how the developer writes code, so here we will discuss some essential standards regardless of the programming language being used.

The following are some representative coding standards:

Coding
  1. Indentation: Proper and consistent indentation is essential in producing easy to read and maintainable programs.
    Indentation should be used to:
    • Emphasize the body of a control structure such as a loop or a select statement.
    • Emphasize the body of a conditional statement
    • Emphasize a new scope block
  2. Inline comments: Inline comments analyze the functioning of the subroutine, or key aspects of the algorithm shall be frequently used.
  3. Rules for limiting the use of global: These rules file what types of data can be declared global and what cannot.
  4. Structured Programming: Structured (or Modular) Programming methods shall be used. "GOTO" statements shall not be used as they lead to "spaghetti" code, which is hard to read and maintain, except as outlined line in the FORTRAN Standards and Guidelines.
  5. Naming conventions for global variables, local variables, and constant identifiers: A possible naming convention can be that global variable names always begin with a capital letter, local variable names are made of small letters, and constant names are always capital letters.
  6. Error return conventions and exception handling system: Different functions in a program report the way error conditions are handled should be standard within an organization. For example, different tasks while encountering an error condition should either return a 0 or 1 consistently.

Comments

Popular posts from this blog

What is computer programming?