Actions

EmSys

CCoding Style - Comments

From EdWiki

Comments

  • 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.

1

  /*
    * default
  */
  default: 
      break;

2

 /* increment zero entry number */
  zerocount++;

3

/* return SUCCESS */
 return SUCCESS;

4

/* initialize “total” to number_received */
 node->total = node->number_received;