what are the coding standard guidelines
Answers
Answer:
What Are Coding Rules and Guidelines?
Safe: It can be used without causing harm.
Secure: It can't be hacked.
Reliable: It functions as it should, every time.
Answer:
The standard coding guidelines are limited use of global, Standard headers for different modules, naming conventions for local variables, global variables, constants and functions, Indentation, a code style that is too challenging to grasp should be avoided, and avoid using the same identifier more than once.
Explanation:
Coding:
- The primary objective of the coding phase is to write high-level code using the design document created during the design phase, and then to unit test this code.
- Coding standards are a set of guidelines that reputable software development companies expect their programmers to adhere to.
- According to their organization's needs and the kinds of software they create, they typically create their own coding standards and rules.
- Maintaining coding standards is crucial for programmers; otherwise, the code would be rejected during code review.
Purpose to have coding standards:
- A coding standard offers the codes created by various engineers a uniform appearance.
- It also minimizes complexity while enhancing readability, maintainability, and intricacy of the code.
- It facilitates code reuse and makes error detection simple.
- It encourages good programming practices and boosts programmers' productivity.
Standard Coding Guidelines:
- Limited use of global: These guidelines outline the data types that can and cannot be declared global.
- Standard headers for different modules: These guidelines outline the data types that can and cannot be declared global. The following are some of the naming conventions:
- the module's name
- Created on date for module
- Who wrote the module?
- modifications made
- Brief description of the module's functions
- The module supports a variety of functions and lists their input and output parameters.
- The module accesses or modifies global variables.
- Naming conventions for local variables, global variables, constants and functions: Anyone can understand a variable's purpose if its name is meaningful and understandable.
- While the names of global variables should begin with a capital letter, those of local variables should be named using camel case letters beginning with a tiny letter (for example, localData) (e.g. GlobalData). Only capital letters should be used to create constant names (e.g. CONSDATA).
- Avoid using digits in variable names whenever possible.
- Function names should be written in camel case, beginning with a small letter.
- Indentation: For the code to be more readable, proper indentation is crucial.
- Programmers should use white space effectively for readable code. Here are some examples of spacing conventions:
- After providing a comma separating two function arguments, a space is required.
- Each nested block needs to be spaced and indented correctly.
- Each block in the program should have the appropriate indentation at the start and the end.
- All braces should begin on a new line, and the code that comes after them should do the same.
A code style that is too challenging to grasp should be avoided: Code need to be simple to understand. Maintenance and bug fixing are difficult and expensive because of the sophisticated code.
Avoid using the same identifier more than once: instead, give each variable a meaningful name that describes its function.
- If an identifier is used for multiple purposes, this is not possible, and the reader may become confused as a result.
- Furthermore, it makes future improvements more challenging.
#SPJ2