Commenting Classes
- Describe the design approach to the class
- Describe limitations, usage assumptions, and so on
- Comment the class interface, can someone easily understand how to use the class without actually looking at the implementation
- Don't document implementation details in the class interface
Here is an example:
/*-------------------------------------
Class Declarations
-------------------------------------*/
/*-------------------------------------------------------
Class: PerfTimer
Desc: Simple Performance Timer
Notes:
1. Wrapper around WIN32 QueryPerformanceCounter()
API function.
Usage:
Create PerfTimer variable
wrap code to be timed with calls to start()/stop()
call Dump() to display results to user.
-------------------------------------------------------*/
-- Main.ShawnDB - 16 Jun 2008
to top