If “price” is something other than the most obvious meaning, then your comment should describe what “price” means and is used, and not just what it is called.
Some hypothetical examples:
- Is it a “pre-tax price” or a “price including tax”?
- Is it expressed in dollars, euros or pounds?
- Is it rounded to the nearest cent, 5 cents or dollars?
- Is this a special value returned to indicate a free element (e.g. 0.0f)?
- Can the price be “uninitialized”, and if so, what value is returned (for example, -1.0f)?
For a good proportion of methods and properties, you can say that tells the reader more than just the name will tell them. This will save other programmers a lot of time and reduce the risk of errors. Even if he simply confirms his assumptions / assumptions, he will still save their time.
In the case of “simple” values that do not require any explanation (for example, Rectangle.Width), then do not waste your time typing - AtomineerUtils will create this documentation level for you with one click. (The advantage of AtomineerUtils in your case is that it supports XML comment formats Doxygen, Javadoc and Documentation and VB, C #, C ++ / CLI, C ++ and C, so you can save your existing format in the same time to significantly reduce the time spent commenting documentation GhostDoc will do a similar task, but it only supports Xml documentation for VB and C #)
Jason williams
source share