man-pages.7: Add some notes on comments in example code

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2020-12-27 11:50:11 +01:00
parent 1297239d41
commit f18f9c4095
1 changed files with 9 additions and 1 deletions

View File

@ -949,7 +949,15 @@ Example programs should ideally be short
though in some cases longer programs may be necessary
to properly illustrate the use of an API.
.IP *
Expressive code and useful comments are appreciated.
Expressive code is appreciated.
.IP *
Comments should included where helpful.
Complete sentences in free-standing comments should be
terminated by a period.
Periods should generally be omitted in "tag" comments
(i.e., comments that are placed on the same line of code);
such comments are in any case typically brief phrases
rather than complete sentences.
.IP *
Example programs should do error checking after system calls and
library function calls.