Learning ActionScript 2.0 in Adobe Flash |
|
|
|
| Best Practices and Coding Conventions for ActionScript 2.0 > Using comments in your code > Adding comments to classes | |||
The two kinds of comments in a typical class or interface file are documentation comments and implementation comments.
|
NOTE |
Documentation and implementation comments are not formally represented in the ActionScript language. However, they are commonly used by developers when writing class and interface files. |
You use documentation comments to describe the code's specifications, but not the implementation. You use implementation comments to comment out code or to comment on the implementation of particular sections of code. Documentation comments are delimited with /** and */, and implementation comments are delimited with /* and */.
Use documentation comments to describe interfaces, classes, methods, and constructors. Include one documentation comment per class, interface, or member, and place it directly before the declaration. If you have additional information to document that does not fit into the documentation comments, use implementation comments (in the format of block comments or single-line comments).
Start classes with a standard comment, which uses the following format:
/**
User class
version 1.2
3/21/2004
copyright Adobe Systems Incorporated
*/
After the documentation comments, declare the class. Implementation comments should directly follow the declaration.
|
NOTE |
Don't include comments that do not directly relate to the class that's being read. For example, don't include comments that describe the corresponding package. |
Use block, single-line, and trailing comments within the body of your class to comment on your ActionScript code. For more information on using comments in class files, see Adding comments to classes.
|
|
|
|