What is the best practice of placing example usage in code documentation? Is there a standardised way? With an @usage or @notes? Do document generators tend to support this?
I know this question should depend on the documentation generator. However, I'm trying to get a habit of using a commenting style for doc generation before getting into the idiosyncrasies of each generator; seems there are more similarites than differences.
I've experimented with Doxygen & often use AS3, JS, PHP, Obj-C, C++.
For example:
/**
* My Function
* @param object id anObject
* @usage a code example here...
*/
function foo(id) {
}
or
/**
* My Function
* @param object id anObject
* @notes a code example here, maybe?
*/
function foo(id) {
}
Thanks