Documenting Your Code

From that first ever prime number identification program to complex .NET applications, programming has come pretty fascinating. And when we cruise into advanced programming loaded with enormous experience, writing complicated code becomes fun. Though it gives nightmare to code reader but for you as a developer, it is even more amazing, isn’t it?

But since we might need to share the code with someone at later stage or, if we only see that code some 5 years down the line, we might end up completely trapped in our own web of complicacy, so solution yes is documentation. And not just simple documentation, but a systematic and orderly one which makes full sense and has carefully chosen words that clearly tells what the code means.

Now when we have realized the importance of documenting our code, we must find out optimized ways to write good text that in contrast with our programming skills is simpler and easy to fathom.

Before you begin the coding, do write what the code is supposed to do. Also key down some key elements that the following function in particular is going to use or create. Then get started and finish up your code. Now get back to the documentation you did when you started. See, does it still match with the functionality of code or you have made some changes. If yes, modify your text accordingly and proceed.







The documentation that you did at beginning also gives you a way to check whether you deviated from the purpose of coding or you are on line. This is useful in cases when you are writing a complex function and which might take days to work. In such scenario, that pre written text will help you out to check with the aim you had set.

Apart from writing the summary at start, your code also should be accompanied with small and relevant comments or one liner. This doesn’t mean that you start commenting even declarations, assignments, but you can of course write that this code is about to invoke this service of application and so on. In all cases, common sense must prevail.

So, be a good all round programmer, do document your code properly. Because well documented code tells the reader that the developer of this application was a systematic person. So, it’s a good idea to earn some respect, isn’t it?

-
About the Author:
I’m a software engineer and a freelance writer. visit my sites www.lakesparadise.com, http://avidwebsolutions.in.
Read my articles at prashlogic.blogspot.com
Article Source