Erste Seite Zurück Weiter Letzte Seite Grafik
Documentation - Comments
How to comment:
- single lines
- if the code is complicated enough
- to mark the end of (nested) blocks
- the line had an error and you want to record
- for maintenance notes
- local variables and data
- don't if it is a repeat of the code
- don't overdo it (e.g. don't comment every line)
paragraphs of code
- comment on the codes intent (comment why, not how)
- to prepare the reader what follows
- to document surpises
- comment on any work-arounds, undocumented features
- don't comment tricky code, rewrite it!