To be really useful, generic function documentation should contain the following items.
- Function Name in large type
- A declaration if it is generic to all of ExtendScript, to all of JavaScript, unique to Adobe InCopy or Adobe InDesign.
- The function's purpose. List what the function does and why you would want to use it. This should be like a sales statement -- why should a user want to use this function.
- What is returned and under what conditions. Note, not every function has to return things. Some really useful generic functions modify things without returning anything.
- What other functions are called. A perfect generic function shouldn't call other functions, but, sometimes it is handy, so list what other functions will be called.
- Function Version or Edit Date. Because functions can be updated, it is a good idea to list the date the function was written or edited each time the function has changed.
- Copyright or usage notes.
Comments?
No comments:
Post a Comment