Marking "example usage" in code documentation
- by Ross
What the best practice of placing example usage in code documentation? Is there a standardised way? With an @usage or @notes?
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) {
}
I know this question should dependent on the documentation generator, but any heads up appreciated...
I'm trying to get into the habit of using proper style. When time allow I'll get more into the generators. (I've experimented with Doxygen.) I often use AS3, JS, Obj-C, C++.
Thanks