Monday, 26 May 2014

Coding standards and Its importance in daily routine for programmers

In the field of software development, there is always a case, where a software project is needed to be expanded day by day. As the software functionality grows, the most important task of development process becomes to be maintaining the existing code and at the same time adding more functionality to it. Thus here coding standards play an important role.

What happens if the standards are not maintained? The code becomes difficult to read and understand. That means if one developer leaves maintaining a codebase and another developer tries to continue development from where previous developer left, or in another case a developer tries to read his own code after long time. If the code is a mess. It would be the most difficult to maintain and continue development. As a result either we have to leave that codebase and it also results in loss of time and money, we have invested on that software codebase.

Every language has some standards to write and comment code, so that it becomes easy to read, understand and develop further.  Coding Standards includes following things:
·         Comments to be added for each function working code blocks
·         Maintaining a code structure, such as hierarchy and proper spacing
·         Easy to understand and use File Structure
·         Re-using  the repeating code blocks
·         Documentation for functioning of code blocks and function parameters
·         Modular approach for development, so that it is easy to add/remove functionality
·         Properly sanitizing user input data, then processing in efficient way

As an example, PHP language has some coding standards. Most popular of them is PEAR standard for coding and documentation. That includes file revision, author, package and software version number. It also helps to mention depreciated functions, so that users should be aware and these are going to be removed in next versions.

To Learn more about PHP’s PEAR standard visit: http://pear.php.net/manual/en/standards.php



No comments:

Post a Comment