Mandatory method documentation
- by Sjoerd
On my previous job, providing all methods with javadoc was mandatory, which resulted in things like this:
/**
* Sets the Frobber.
*
* @param frobber The frobber
*/
public setFrobber(Frobber frobber) { ... }
As you can see, the documentation adds little to the code, but takes up space and work.
Should documenting all methods be mandatory or optional? Is there a rule for which methods to document? What are pros and cons of requiring every method to be documented?