Coding Standards for Writing Functions

Whether its C programming language or C++ programming language or PHP, we should have a coding standard in place before starting with the code development. Coding standard is a predefined standard which should be followed during the code development which will improve the quality of the code.

The coding standards varies from organization to organization. Each organization define their own coding standard and follow them to achieve the desired code quality.

Here, we will define a coding standard for writing functions.

Coding Standards for Writing Functions

  • A function name should be preceded by fn
  • The first character in the function name should be written in uppercase. Every subsequent word in the function name should start with an uppercase alphabet.

    Example:
    fnFactorial
    fnItemDisplay

  • The function should begin with a header which describes about the function. It is written as follows:

You may also like...

1 Response

  1. March 17, 2014

    […] Also see: How does using functions make writing large programs easier? Coding Standards for Writing Functions […]

Leave a Reply

Your email address will not be published. Required fields are marked *