Mandatory Method Documentation

In my previous work, providing all methods using javadoc was mandatory, which led to the following things:

/**
 * Sets the Frobber.
 *
 * @param frobber The frobber
 */
public setFrobber(Frobber frobber) { ... }

As you can see, the documentation takes up space and works, but adds little code.

Should all methods be documented as required or optional? Is there a rule for which methods to document? What are the pros and cons of documenting each method?

+3
source share
6 answers

"providing all methods with javadoc was mandatory"

, , javadoc , , , , .

, javadoc, javadoc - , HTML, , ..

, , , . - XML - . , // Sets this object to use the specified frobber for all future frobbing, javadoc .

, , this , set() frobber, while(!frobber.isset()) { refrigerator.add(frobber); sleep(3600); refrigerator.remove(frobber); } , " frobber". , - , "set" - OED. , , , - , , , , . , " frobber" "frobber" IDE javadoc-. , frobbing (, ), , .

- , . Java interface s, "" - , . , , . , - , , .

, IMO . , cone of shame , - , .

, , , , . , , , , . , " javadoc ", , , , .

+3

/ , , . . , , , , , , . .

0

. - . , , .

, , . , -, , , , . , , , .

:

, , , , .

:)

0

"" . , (, < 10 ), . - , , - !

InfoQ.

0

. Javadoc ( ) - . , Javadoc . , , , .

, , . , , , . , 0 1. .

- . Frobber, setFrobber . Javadoc, , . frobIt , 3 . .

​​ Javadocs ither, . , .

0

: ?

A: .

Q: , ?

A: .

: ?

A: : , , . . . : Whining. .

  • , .

  • get set . . , . , , .

: . , eh?

0
source

Source: https://habr.com/ru/post/1737105/


All Articles