I'm a PHP web developer, who is looking for a well proven method for writing a good documentation (aka docblock).
There are several documentation styles, for instance:
- The descriptive but not categorized (#1):
/** * Element name: class, function, variable etc. (Optional) * * Short description. * * Long description. */
- The categorized (#2):
/** * Function name * * @param $foo * @return bar */
- The template-like (#3):
/** ********************** * NAME: Func_Name * DESC: Does A Lot * RETurn: number * NOTES: foo bar foo... ********************** */
- Variations of the aforementioned methods.
But which documentation style should I adopt?
I assume that different documentation styles should be used for different language elements:
Functions perhaps should use the #2 method,
while a class should use the #1 method.
An inline code may be documented this way (#5):
// short description // of // what the following code does.
I know phpDocumentor, but dislike the idea of learning how to use it.
It seems ridiculous to learn how to use something like phpDocumentor just so I could document my code.
(although I appreciate any open-source project, including phpDocumentor)