Skip to topic
|
Skip to bottom
Jump:
TModeling
TModeling Web
TModeling Web Home
Changes
Notify
Index
Search
Webs
BioGeometry
Main
TModeling
TWiki
Edit
Attach
Printable
TModeling.CommentingRoutines
r1.1 - 19 Jun 2008 - 11:54 - Main.guest
topic end
Start of topic |
Skip to actions
*Commenting Routines* --- * Keep comments close to the code they describe * Describe each routine in one or tow simple sentences at the top of the routine * Document parameters where they are declared (good exception to endline comment rule) * Take advatage of code documentation utilities (ex: [[http://en.wikipedia.org/wiki/Javadoc][JavaDoc]]) * Differentiable between input and output data * Document interface assumptions * Comment on any routine limitations * Document any global side-effects (IE if the routine modifies global data) * Document the source any algorithms that are used (give credit where credit is due) * Use comments to mark parts of your program for quick searches, see !JavaDoc conventions for more details <verbatim> Short Example: /**-------------------------------------------------------- Name: SPreaderAux::compute_bounding_box Desc: Computes min/max bounds for vertices/triangles ---------------------------------------------------------*/ /*virtual*/ bool SPreaderAux::compute_bounding_box() { ... } Long Example: /**-------------------------------------------------------- Name: SPreaderAux::compute_stats Desc: Compute statistics for Vertices and Triangles Notes: 1. Assumes stream has already been properly opened 2. Assumes stream is properly positioned to read the first command (vertex/triangle) from stream (IE any header info has been read...) 3. User should either close() the reader or restart() reader after computing stats ---------------------------------------------------------*/ /*virtual*/ bool SPreaderAux::compute_stats() { ... } </verbatim> -- Main.ShawnDB - 16 Jun 2008
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
More topic actions
Revisions: | r1.1
|
Total page history
|
Backlinks
You are here:
TModeling
>
CommentingRoutines
to top
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback