<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Comments on Gabriel Mongeon</title><link>https://gabrielmongeon.ca/en/tags/comments/</link><description>Recent content in Comments on Gabriel Mongeon</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 08 Dec 2010 21:02:00 -0500</lastBuildDate><atom:link href="https://gabrielmongeon.ca/en/tags/comments/index.xml" rel="self" type="application/rss+xml"/><item><title>Reference Documentation</title><link>https://gabrielmongeon.ca/en/2010/12/reference-documentation/</link><pubDate>Wed, 08 Dec 2010 21:02:00 -0500</pubDate><guid>https://gabrielmongeon.ca/en/2010/12/reference-documentation/</guid><description>&lt;p>In the &lt;a href="http://msdn.microsoft.com/en-us/magazine/gg412507.aspx">November edition of MSDN Magazine&lt;/a>, &lt;a href="http://msdn.microsoft.com/magazine/ee532098.aspx?sdmr=PeterGruenbaum&amp;amp;amp;sdmi=authors">Peter Gruenbaum&lt;/a> explains how to write good reference documentation for APIs in his article titled “&lt;a href="http://msdn.microsoft.com/en-us/magazine/gg309172.aspx">A Coder’s Guide to Writing API Documentation&lt;/a>”.&lt;/p>
&lt;p>My attention was particularly drawn to Figures 2 and 3, which explain how to comment while maintaining consistency throughout the API. I have reproduced them here:&lt;/p>
&lt;p>&lt;strong>Figure 2: Reference Documentation Style&lt;/strong>&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>&lt;strong>Type&lt;/strong>&lt;/th>
 &lt;th>&lt;strong>Guideline&lt;/strong>&lt;/th>
 &lt;th>&lt;strong>Examples&lt;/strong>&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>Class&lt;/td>
 &lt;td>Start with a word like “Represents”&lt;/td>
 &lt;td>“Represents a user’s photo album.”&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Methods and functions&lt;/td>
 &lt;td>Start with a verb&lt;/td>
 &lt;td>“Returns the number of contacts for the specified area.”&lt;br>&lt;br>“Pauses the video.”&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Properties&lt;/td>
 &lt;td>Use a noun or start with verbs such as “Gets” or “Gets and sets”&lt;/td>
 &lt;td>“The user’s tasks.”&lt;br>&lt;br>“Gets and sets a collection of the user’s tasks.”&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Events&lt;/td>
 &lt;td>Start with a phrase such as “Raised when” or “Occurs when”&lt;/td>
 &lt;td>“Raised when the response from server is received.”&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>XML elements&lt;/td>
 &lt;td>Use a noun-based phrase&lt;/td>
 &lt;td>“The city’s postal code.”&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Boolean values&lt;/td>
 &lt;td>For Boolean properties, start with “Indicates whether”; for Boolean return values on methods and functions, start with “Returns whether”&lt;/td>
 &lt;td>“Indicates whether the control is visible.”&lt;br>&lt;br>“Returns whether two regions intersect.”&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>Figure 3: Reference Documentation Example&lt;/strong>&lt;/p></description></item></channel></rss>