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.


  • The function should begin with a header which describes about the function. It is written as follows:
    * Function:	fnFactorial()					
    * Description:	Accepts an integer and finds the                      
    *               factorial
    * Input Parameters: 
    *	int  - Number for which factorial to be found
    * Returns: int - Factorial of the given integer
    int fnFactorial(int intNumber)
       /*code to calculate factorial of a number*/

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.

FREE C Programming Cheatsheet

FREE C Programming Cheatsheet


Cheatsheet for a quick glance at C programming concepts and syntax

Thank you! Check you inbox and access your cheat-sheet