CCoding Style - Comments
Revision as of 09:30, 23 June 2015 by Jshankar (1 revision imported: EdWiki -- Emsys pages from Shukra)
- Comments are meant to help the reader of a program. They don’t help by saying things the code already plainly says, or by contradicting the code, or by distracting the reader with elaborate typographical displays.
- The best comments aid the understanding of a program by briefly pointing out salient details or by providing a larger-scale view of the proceedings.
- Comments shouldn’t report self-evident information, such as the fact that i++ has incremented i.
/* * default */ default: break;
/* increment zero entry number */ zerocount++;
/* return SUCCESS */ return SUCCESS;
/* initialize “total” to number_received */ node->total = node->number_received;