By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,961 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,961 IT Pros & Developers. It's quick & easy.

Basic commenting while programming

P: 9
Anyone please expalin me the basic concepts in commenting while programming

how to comment
functions
loops
header file
main logic

etc ..with exaples
Sep 17 '06 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
Almost all the coding stands I have worked to have the following to say
  • It is possible to over comment your code and make it unreadable, large sections of comments should be reserved for file and procedure headers.
  • Comments should add meaning to the code, a comment that just says what is readily decerable from the code itself is useless.
  • The code already tells you what is happening (most of the time), the comment should tell you why it is happening.
  • Procesdures/functions should have comment blocks explaining the input and outputs of the procedure and what operation or function it performs.
  • Files should have comment block headers giving original author and originating date plus other information that may be useful to the project, possibly including comments auto generated by the version control software.
Sep 17 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.