Question

when using default parameter, I set

void method1(float v, float w =1.0)

Is this a good practice to use the comment in the definition like

void class::method1(float v, float w /*=1/0*/)
Was it helpful?

Solution

I would prefer some doxygen compliant documentation this way:

/**
 * Description of the behavior/purpose of your method
 * 
 * @param v The float 'v' (whatever this means)
 * @param w Optional float 'w' (whatever this means), default value is 1.0.
 */
void method1(float v, float w =1.0);

Usually I'm not going to put additional comments with implementation specific blocks,

OTHER TIPS

Intellisence in most of the IDE will work, if not you can keep comment as well. I do not think any harm in this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top