Stephen Colebourne's blog: Javadoc coding standards - 0 views
blog.joda.org/...javadoc-coding-standards.html
java javadoc BestPractices documentation design communication

-
Javadoc coding standards
- ...63 more annotations...
-
benefit from it.
-
think of it as internal design documentation when you revisit this code 8 months from now: - based on nothing but your well-chosen ;) package/class/method/variable names, will you recall all of your current design intentions and rationale? likely not - when you hand-off this code to another software engineer, how easy will it be to mostly rtfm? will you have to waste time preparing design/implementation notes specifically for the hand-off? if this is the case because the code is unreadable and not self-guiding and there's not already at least high level design notes in a wiki, you're doing it wrong!
-
-
If a method is overridden in a subclass, Javadoc should only be present if it says something distinct to the original definition of the method
-
Place a single <p> tag on the blank line between paragraphs:
-
it has the responsibility of summing up the method or class to readers scanning the class or package
-
@code feature provides a section of fixed-width font, ideal for references to methods and class names
-
Adding @code for every occurrence is a burden to both the reader and writer of the Javadoc and adds no real value.
-
correct approach is an @param tag with the parameter name of <T> where T is the type parameter name.
-
They should start with a lower case letter, typically using the word "the". They should not end with a dot. This aids readability in source code and when generated.
-
Define null-handling for all parameters and return types
-
"null treated as xxx"
-
"null returns xxx"
-
This wastes everyone's time and decreases the overall value of the documentation. When you have nothing useful to say, say nothing!