Wednesday, January 09, 2008

Software Module Header Structure

    After much research, i found a quite standard way of writing headers for software projects. It is used in almost every professional development environment. These are just some specifications, individuals or firms may have their own changes according to their requirements.

   The need for such a standardisation is that once a module is written and debugged, the author or other software developers may understand cleanly what is going on and would help in debugging for the entire application, modification without sideeffects and ofcourse as a strong supporter of the "Open Source" movement, code sharing.

Module Header Format ($ revisoon 2)
--------------------------------------------
* Name of Module
* Synopsis of Module
* Date of creation
* Author's Name
* [Modification History]
* [Different Functions supported with in / out params]
* [Global Variables accessed or modified by it]

--End--

eg : say the module header of a new program that i created might have the following header

--Start--
* ClientScroller
* script that Scrolls the client area up and down
* Decemebr 2007
* Midhun Harikumar (Centrum inc Software Solutions)

$ Version 0.32

--End--

    Another important specification is regarding the use of global variables. While using Object Oriented Programming, i guess there would be minimum amount of 
global variables lying around. The specification is to name the global variables 
with a leading small case g and underscore.

eg :
int g_nDestFileCount;

    This way we can easily figure out where the global variables are used and might help
debugging a lot easier.

No comments: