Function comments convention?

Hello,

Can anyone tell me what's the convention for adding comments describing the pre and post condition of a function?

In my textbook it does the comments after the function's prototype. In one of my classes' lecture it does it near the method header:

void hey(int yo, int bye)
//comments
{
}

However, my TA said he most commonly sees it before the method header statement.

So I'm not too sure here. Thanks.
Convention, regarding comments? Get real.

Anyway, if you use a documentation generator, such as Doxygen, you can add precondition and postcondition comments:

1
2
3
4
5
6
7
/**
@pre yo must be > 2
@post whatever
*/
void hey(int yo, int bye)
{
}


http://en.wikipedia.org/wiki/Doxygen

If you're using another language such as D... it has its own documentation system, Ddoc... why do I even bother.
Topic archived. No new replies allowed.