rathinagiri wrote:
Now coming to remarks.
What do you think about remarks? Should they be included at the module head, variable declaration, important logic, user interface or what?
In my opinion (and coding style) on commenting is: a major necessity of program writing.
Necessity foremost for myself. If commenting disregarded, I couldn't understand my prg wrote before only a few years
And then necessity for my friends, students, co-worker, anyone who I'll demand his help etc.
Should be included
- at the module head? Yes !
- at variable declarations? Yes!
- important logic? Yes!
in short: at everywhere !
Since commenting is a sub topic of coding style, we can pose same measure : "
How commented you like programs came to you for read; comment your program that way."
But what, we have some points to emphasize:
- Don't exaggerate! If so, your code may lost, become unnoticeable in crowded remarks
- Remarks must be clear, meaningful and needful.
For example :
This is needless:
Code: Select all
USE MYTABLE // Open database file
Instead may be :
Code: Select all
USE MYTABLE // Open customer table
( In fact, there is a "Naming" problem here. MYTABLE isn't a good file name.
Names must externalize its content)
In other hand, "module head" remarks has a special importance : When compiled adequately written module head remarks, this will be a sufficient software documentation
I'm using a special way for commenting: put module explanation in a single sentence at first line of module; for example:
Code: Select all
PROC MsgMulti(; // Build a message with multiple value in any type
xMesaj,;
cTitle )
And when I run DBMList, I get a explained module list
I'm afraid that I'm talking about known issues
Regards
--
Esgici