Commenting functions
- From: amvoiepd@xxxxxxxxxxxx
- Date: Sat, 29 Dec 2007 11:30:30 -0800 (PST)
Hi!
I would like some help on deciding on a good way to write comments
that describes functions, like, it's parameters, return value and so
on.
Take this for example:
/*
* Returns 1 if parent is parent of window.
*/
int is_parent_of(struct Win *parent, struct Win *window)
{
...
}
Not very nice when the same word is used as the name of one
parameter, how would I separate those two? And also describe
return values and similar in a systematic way?
Also should one write "Returns 1 if ... " or "Return 1 if ..." ?
I know this is a personal style matter, but since I really don't
know it would be nice to know if there is some widely used style.
.
- Follow-Ups:
- Re: Commenting functions
- From: stdazi@xxxxxxxxx
- Re: Commenting functions
- From: Ben Pfaff
- Re: Commenting functions
- From: William Pursell
- Re: Commenting functions
- From: Randy Howard
- Re: Commenting functions
- Prev by Date: Re: Brian Kernighan, maybe I'm not worthy, maybe I'm scum
- Next by Date: Re: Brian Kernighan, maybe I'm not worthy, maybe I'm scum
- Previous by thread: Untangling Multi-function Recursion
- Next by thread: Re: Commenting functions
- Index(es):
Relevant Pages
|