<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Little Secret</title>
	<atom:link href="http://elegantcode.com/2008/09/24/little-secret/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2008/09/24/little-secret/</link>
	<description></description>
	<lastBuildDate>Wed, 17 Mar 2010 08:54:42 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2008/09/24/little-secret/comment-page-2/#comment-33590</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Sat, 27 Sep 2008 07:16:10 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/09/24/little-secret/#comment-33590</guid>
		<description>What I was trying to say is that if the comments can be generated by a tool, then what is the point of writing comments then. If a tool can figure it out, then a human certainly will.</description>
		<content:encoded><![CDATA[<p>What I was trying to say is that if the comments can be generated by a tool, then what is the point of writing comments then. If a tool can figure it out, then a human certainly will.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Carter</title>
		<link>http://elegantcode.com/2008/09/24/little-secret/comment-page-2/#comment-33545</link>
		<dc:creator>Chris Carter</dc:creator>
		<pubDate>Sat, 27 Sep 2008 00:38:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/09/24/little-secret/#comment-33545</guid>
		<description>&quot;...but if its output can be generated from the code itself, then what’s the point?&quot;

@Jan: how is the output from Ghostdoc generated from the code itself?</description>
		<content:encoded><![CDATA[<p>&#8220;&#8230;but if its output can be generated from the code itself, then what’s the point?&#8221;</p>
<p>@Jan: how is the output from Ghostdoc generated from the code itself?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2008/09/24/little-secret/comment-page-2/#comment-33508</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 26 Sep 2008 14:56:31 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/09/24/little-secret/#comment-33508</guid>
		<description>@Chris: I&#039;m a GhostDoc user for as long as I can remember. The tool is nice for micro-comment productivity, but if its output can be generated from the code itself, then what&#039;s the point?</description>
		<content:encoded><![CDATA[<p>@Chris: I&#8217;m a GhostDoc user for as long as I can remember. The tool is nice for micro-comment productivity, but if its output can be generated from the code itself, then what&#8217;s the point?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Marisic</title>
		<link>http://elegantcode.com/2008/09/24/little-secret/comment-page-2/#comment-33504</link>
		<dc:creator>Chris Marisic</dc:creator>
		<pubDate>Fri, 26 Sep 2008 13:40:32 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/09/24/little-secret/#comment-33504</guid>
		<description>I suggest using Ghost Doc http://www.roland-weigelt.de/ghostdoc/ This tool will auto generate comments for you for methods/properties based off the naming structure along with the parameters.

Combine this with Resharper www.jetbrains.com which will inform you when comments for methods have parameters that don&#039;t match or don&#039;t exist or do exist and shouldn&#039;t.

These tools can easily lead to development with zero comment stagnation. I agree with you for in code comments they should only be used on very hacky solutions and for nothing else. Everything else that SHOULD be commented needs to be refactored into variables with proper names for what it is, to seperate methods or even entirely new classes to avoid the need for having to read anything other than the code itself.</description>
		<content:encoded><![CDATA[<p>I suggest using Ghost Doc <a href="http://www.roland-weigelt.de/ghostdoc/" rel="nofollow">http://www.roland-weigelt.de/ghostdoc/</a> This tool will auto generate comments for you for methods/properties based off the naming structure along with the parameters.</p>
<p>Combine this with Resharper <a href="http://www.jetbrains.com" rel="nofollow">http://www.jetbrains.com</a> which will inform you when comments for methods have parameters that don&#8217;t match or don&#8217;t exist or do exist and shouldn&#8217;t.</p>
<p>These tools can easily lead to development with zero comment stagnation. I agree with you for in code comments they should only be used on very hacky solutions and for nothing else. Everything else that SHOULD be commented needs to be refactored into variables with proper names for what it is, to seperate methods or even entirely new classes to avoid the need for having to read anything other than the code itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Beech</title>
		<link>http://elegantcode.com/2008/09/24/little-secret/comment-page-2/#comment-33479</link>
		<dc:creator>Greg Beech</dc:creator>
		<pubDate>Thu, 25 Sep 2008 23:30:13 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/09/24/little-secret/#comment-33479</guid>
		<description>If you&#039;re working on code that is simple enough to write without inline comments then I don&#039;t envy you. The most interesting code needs literally blocks of comments to indicate what&#039;s happening, why things are being done, etc. They are used to explain why a particular approach was taken, and perhaps more important what other approaches were considered and why they were not taken; this simply cannot be done in code. Comments are particularly important in multi-threaded code to explain potential race conditions etc.

My assertion is that code without comments simply doesn&#039;t work: http://gregbeech.com/blogs/tech/archive/2008/08/04/code-without-comments-is-code-that-doesn-t-work.aspx</description>
		<content:encoded><![CDATA[<p>If you&#8217;re working on code that is simple enough to write without inline comments then I don&#8217;t envy you. The most interesting code needs literally blocks of comments to indicate what&#8217;s happening, why things are being done, etc. They are used to explain why a particular approach was taken, and perhaps more important what other approaches were considered and why they were not taken; this simply cannot be done in code. Comments are particularly important in multi-threaded code to explain potential race conditions etc.</p>
<p>My assertion is that code without comments simply doesn&#8217;t work: <a href="http://gregbeech.com/blogs/tech/archive/2008/08/04/code-without-comments-is-code-that-doesn-t-work.aspx" rel="nofollow">http://gregbeech.com/blogs/tech/archive/2008/08/04/code-without-comments-is-code-that-doesn-t-work.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph Ferris</title>
		<link>http://elegantcode.com/2008/09/24/little-secret/comment-page-1/#comment-33467</link>
		<dc:creator>Joseph Ferris</dc:creator>
		<pubDate>Thu, 25 Sep 2008 17:03:58 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/09/24/little-secret/#comment-33467</guid>
		<description>I think that XML comments are too important to be limited to a public scoping.  While I love having SandCastle as part of my post-build process to generate my documentation, I am even a bigger fan in having Intellisense tips throughout the application.

For my team, verifying the validity of a comment in a changed section of code is part of the code review process.  It really becomes second nature, and it is very easy to spot when the code has changed enough to be different from the comment provided.  Beyond that, it is an indispensable reference tool for new developers to be able to hover over anything in the IDE and see the description, as opposed to jumping to definitions or running split windows.

Of course, it comes down to a little bit of personal preference and team buy-in, as well.  The team, collectively, wants this level of functionality and understands the responsibility to make it valuable on an ongoing basis.

Beyond that, I am in complete agreement.  When inline commenting becomes common practice, it is usually indicative of the need for refactoring.  I try to limit my use of commenting to explicitly call out TODO items or to note why one approach was chosen over another.</description>
		<content:encoded><![CDATA[<p>I think that XML comments are too important to be limited to a public scoping.  While I love having SandCastle as part of my post-build process to generate my documentation, I am even a bigger fan in having Intellisense tips throughout the application.</p>
<p>For my team, verifying the validity of a comment in a changed section of code is part of the code review process.  It really becomes second nature, and it is very easy to spot when the code has changed enough to be different from the comment provided.  Beyond that, it is an indispensable reference tool for new developers to be able to hover over anything in the IDE and see the description, as opposed to jumping to definitions or running split windows.</p>
<p>Of course, it comes down to a little bit of personal preference and team buy-in, as well.  The team, collectively, wants this level of functionality and understands the responsibility to make it valuable on an ongoing basis.</p>
<p>Beyond that, I am in complete agreement.  When inline commenting becomes common practice, it is usually indicative of the need for refactoring.  I try to limit my use of commenting to explicitly call out TODO items or to note why one approach was chosen over another.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry Vander Stelt</title>
		<link>http://elegantcode.com/2008/09/24/little-secret/comment-page-1/#comment-33460</link>
		<dc:creator>Henry Vander Stelt</dc:creator>
		<pubDate>Thu, 25 Sep 2008 13:49:47 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/09/24/little-secret/#comment-33460</guid>
		<description>I&#039;m a big fan of inline comments and I tend to be critical of code that does not contain any inline comments.  That being said, inline comments should never be used as an excuse for indecipherable code.  Here are my basic rules:

1. Any logic that is somewhat complex should be put in its own method with a very descriptive name.  In addition to making the code more testable, inline comments may be able to be avoided.

2. Anything within the body of a method that is not obvious given the purpose of the routine should have a comment.

3. Anything that relies on non-obvious business rules or unusual usage of an API should be commented.

Even though I enjoy reading other people&#039;s code, English is still my primary language, and compiling code in my head to determine it&#039;s intent becomes annoying very quickly.</description>
		<content:encoded><![CDATA[<p>I&#8217;m a big fan of inline comments and I tend to be critical of code that does not contain any inline comments.  That being said, inline comments should never be used as an excuse for indecipherable code.  Here are my basic rules:</p>
<p>1. Any logic that is somewhat complex should be put in its own method with a very descriptive name.  In addition to making the code more testable, inline comments may be able to be avoided.</p>
<p>2. Anything within the body of a method that is not obvious given the purpose of the routine should have a comment.</p>
<p>3. Anything that relies on non-obvious business rules or unusual usage of an API should be commented.</p>
<p>Even though I enjoy reading other people&#8217;s code, English is still my primary language, and compiling code in my head to determine it&#8217;s intent becomes annoying very quickly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dew Drop - September 25, 2008 &#124; Alvin Ashcraft's Morning Dew</title>
		<link>http://elegantcode.com/2008/09/24/little-secret/comment-page-1/#comment-33452</link>
		<dc:creator>Dew Drop - September 25, 2008 &#124; Alvin Ashcraft's Morning Dew</dc:creator>
		<pubDate>Thu, 25 Sep 2008 11:58:13 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/09/24/little-secret/#comment-33452</guid>
		<description>[...] Little Secret (Jan Van Ryswyck) – An argument against code comments. [...]</description>
		<content:encoded><![CDATA[<p>[...] Little Secret (Jan Van Ryswyck) – An argument against code comments. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2008/09/24/little-secret/comment-page-1/#comment-33447</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Thu, 25 Sep 2008 07:15:08 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/09/24/little-secret/#comment-33447</guid>
		<description>I thought I made it clear that XML comments are valuable for public API&#039;s if and only if they are being maintained (maybe I have to work some more on my writing skills). ASP.NET MVC is definitely a public API.

I still don&#039;t see the case for inline comments though. Like Keith mentioned, I&#039;m more in favor of extracting a private method with a nice descriptive name than putting out a comment.

As I mentioned in my post: there are cases for inline comments, but I do find them rare as I mostly try to solve this with refactoring.</description>
		<content:encoded><![CDATA[<p>I thought I made it clear that XML comments are valuable for public API&#8217;s if and only if they are being maintained (maybe I have to work some more on my writing skills). ASP.NET MVC is definitely a public API.</p>
<p>I still don&#8217;t see the case for inline comments though. Like Keith mentioned, I&#8217;m more in favor of extracting a private method with a nice descriptive name than putting out a comment.</p>
<p>As I mentioned in my post: there are cases for inline comments, but I do find them rare as I mostly try to solve this with refactoring.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Carter</title>
		<link>http://elegantcode.com/2008/09/24/little-secret/comment-page-1/#comment-33430</link>
		<dc:creator>Chris Carter</dc:creator>
		<pubDate>Thu, 25 Sep 2008 01:39:08 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/09/24/little-secret/#comment-33430</guid>
		<description>[beginSarcasm]
I guess if no one else is ever going to use your code, or if they will always have the sourcecode so they can figure out what you mean, then by all means, do NOT comment, I mean, really, I have gobs of time to read sourcecode and/or guess what your code does.
[/endSarcasm]

Take ASP.NET MVC.  Great framework.  ZERO comments(yet).  If I wasn&#039;t able to walk through the source code i&#039;d never know what the expected outcome was supposed to be of many features.  For example, a signature in the HtmlHelper class looks like this in the intellisense: 

  string Hidden(string name)

can anyone(who hasn&#039;t already used the HtmlHelper,  tell me what the does? clearly the name of the element will(should) be whatever value is in name, but what&#039;s the id of the element going to be?

Here&#039;s another one without a comment:

  string TextBox(string name, object htmlAttributes)

What do you stick in htmlAttributes? Thankfully I consume enough caffeine and stay up late enough to read the source code and figure out what goes in there, but a simple little comment would have eliminated the need to read anything beyond the comment.

&quot;The first name&quot; as a comment is stupid, because it doesn&#039;t give any useful information.  However, comments like &quot;Gets or Sets the First Name&quot;, are important [to me] so i know, via intellisense, what&#039;s readonly and what&#039;s not before the compiler let&#039;s me know.

I do agree, if the code speaks more than a comment could, leave the comment off.  Superfluous comments that reiterate in psuedo code what the code does is always annoying.  But if it&#039;s a public API that someone else has to read, ask somebody else to look at it first for clarity before deciding the &quot;no comment ever&quot; direction.  

Furthermore, could you imagine all of the .NET BCL without comments? Yikes.  No thanks.</description>
		<content:encoded><![CDATA[<p>[beginSarcasm]<br />
I guess if no one else is ever going to use your code, or if they will always have the sourcecode so they can figure out what you mean, then by all means, do NOT comment, I mean, really, I have gobs of time to read sourcecode and/or guess what your code does.<br />
[/endSarcasm]</p>
<p>Take ASP.NET MVC.  Great framework.  ZERO comments(yet).  If I wasn&#8217;t able to walk through the source code i&#8217;d never know what the expected outcome was supposed to be of many features.  For example, a signature in the HtmlHelper class looks like this in the intellisense: </p>
<p>  string Hidden(string name)</p>
<p>can anyone(who hasn&#8217;t already used the HtmlHelper,  tell me what the does? clearly the name of the element will(should) be whatever value is in name, but what&#8217;s the id of the element going to be?</p>
<p>Here&#8217;s another one without a comment:</p>
<p>  string TextBox(string name, object htmlAttributes)</p>
<p>What do you stick in htmlAttributes? Thankfully I consume enough caffeine and stay up late enough to read the source code and figure out what goes in there, but a simple little comment would have eliminated the need to read anything beyond the comment.</p>
<p>&#8220;The first name&#8221; as a comment is stupid, because it doesn&#8217;t give any useful information.  However, comments like &#8220;Gets or Sets the First Name&#8221;, are important [to me] so i know, via intellisense, what&#8217;s readonly and what&#8217;s not before the compiler let&#8217;s me know.</p>
<p>I do agree, if the code speaks more than a comment could, leave the comment off.  Superfluous comments that reiterate in psuedo code what the code does is always annoying.  But if it&#8217;s a public API that someone else has to read, ask somebody else to look at it first for clarity before deciding the &#8220;no comment ever&#8221; direction.  </p>
<p>Furthermore, could you imagine all of the .NET BCL without comments? Yikes.  No thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
