Home » Software Engineering

Coding standards and guidelines

In this article, we are going to study about the coding standards and guidelines that are followed in the coding phase of the software engineering paradigm. In this, we will discuss the various coding standards and guidelines and regarding their necessity.
Submitted by Monika Sharma, on November 10, 2019

Coding standards are the set of guidelines or norms that are globally set or are set by various software development organizations (and they hold only to that particular organization) and these guidelines should be followed by all the developers to produce a good quality software. There are various benefits of using the coding standards while coding the software like,

  • Code understanding becomes easier
  • Entire code of the whole software has same format and style of coding
  • Encourages good programming skills

Most of the top software developing companies set their coding standard by their own and these standards are followed by the developers of that particular organizations only. However, there are some common representative coding standards and guidelines that are more overly applicable to all and are mostly followed by every developer or organization. Following are some of them,

  • Rules for global variables declaration:
    There are rules which define what type of variables can be declared as global and what cannot. This helps to maintain the confidentiality of the data and is also helpful in cases where the access rights are to be provided only to the selected group of users.
  • Naming conventions:
    Naming conventions are set for declaring any sort of entity or variable within the software. This provides a regularity in the structure of the names defined. For example, ‘every button should have its name in all capitals’ can be a naming convention.
  • Contents of headers:
    The data that must be there in the header of each module has a pre-defined format. This usually includes the name of the module, data of creation, date of approval, developer’s or author’s name, synopsis, description of the module, description of the variables and functions defined in the module, etc.
  • Error return conventions:
    There are certain conditions in which the input data is bounded within some range. If in such cases, the data entered by the user exceeds the particular range, then an error message should be displayed. The range and criteria for which the error should pop up is defined in the error return conventions.
  • Use coding style that is easy to understand and is globally accepted:
    It is recommended that the coding style that is being followed must be easy to understand and should be similar to that which is globally accepted or else it would be difficult for the user to understand it and also it would take time for the developers to develop a habit of following a completely new coding format.
  • The length of functions or methods should be small:
    It is a good practice to keep the body of the functions small, nearly about 10-12 code lines. This makes the code readable and easily modifiable.
  • Do not unnecessarily use statements that break the control flow of statements:
    It is advised not to use jump, goto and function calls unnecessarily as it takes extra time for the processor to break the going flow, search for the mentioned statement, load those statements, execute them and then return to the previous calling function. Therefore, try to avoid such situations as much as possible.
  • Choose identifier names uniquely within the module:
    Every identifier at least within the module must have a unique name to avoid ambiguity.


Comments and Discussions



Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© some rights reserved.