<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: .NET Coding Guidelines &#8211; Commenting</title>
	<atom:link href="http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/feed/" rel="self" type="application/rss+xml" />
	<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/</link>
	<description>Web development with Microsoft technologies</description>
	<lastBuildDate>Mon, 16 Nov 2009 05:06:59 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: sandrar</title>
		<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-1171</link>
		<dc:creator>sandrar</dc:creator>
		<pubDate>Thu, 10 Sep 2009 14:35:08 +0000</pubDate>
		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-1171</guid>
		<description>Hi! I was surfing and found your blog post... nice! I love your blog.  :) Cheers! Sandra. R.</description>
		<content:encoded><![CDATA[<p>Hi! I was surfing and found your blog post&#8230; nice! I love your blog.  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Cheers! Sandra. R.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iisrael13</title>
		<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-1166</link>
		<dc:creator>iisrael13</dc:creator>
		<pubDate>Wed, 08 Apr 2009 02:56:53 +0000</pubDate>
		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-1166</guid>
		<description>Hello
Can you giv me Post a comment cods? 

My email is: iisrael13@yahoo.com

Thank you!</description>
		<content:encoded><![CDATA[<p>Hello<br />
Can you giv me Post a comment cods? </p>
<p>My email is: <a href="mailto:iisrael13@yahoo.com">iisrael13@yahoo.com</a></p>
<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: legend of mir</title>
		<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-1159</link>
		<dc:creator>legend of mir</dc:creator>
		<pubDate>Fri, 13 Feb 2009 00:38:27 +0000</pubDate>
		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-1159</guid>
		<description>Let’s be honest, there’s only one main purpose to blogging. To translate concentrated rage into HTML. 

PMSL!!!!</description>
		<content:encoded><![CDATA[<p>Let’s be honest, there’s only one main purpose to blogging. To translate concentrated rage into HTML. </p>
<p>PMSL!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: grethen</title>
		<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-1151</link>
		<dc:creator>grethen</dc:creator>
		<pubDate>Mon, 07 Jul 2008 13:00:28 +0000</pubDate>
		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-1151</guid>
		<description>well done and useful content :)</description>
		<content:encoded><![CDATA[<p>well done and useful content <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will Asrari</title>
		<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-42</link>
		<dc:creator>Will Asrari</dc:creator>
		<pubDate>Thu, 23 Aug 2007 18:11:25 +0000</pubDate>
		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-42</guid>
		<description>&quot;I generally read comments as an excuse for not being able to do something correctly.&quot;

lol. Where I&#039;m from we refer to that as a &quot;stove-pipe&quot; system. That or a &quot;duct-taped piece-of-sh*t&quot;.

Eric: If a client REQUIRES comments (some do) then I tell them that I won&#039;t add them until AFTER they agree on the software and check off that it is exactly what they want per the scope of the project.  That way I don&#039;t have to maintain / update comments. In that respect Eric, YOU hit the nail right on the head!

Personally I think the following method is commented enough just by naming conventions and constraints alone.

public static T CalculateMax(T first, T second) where T : IComparable
{
    return second.CompareTo(first) &lt; 0 ? first : second;
}</description>
		<content:encoded><![CDATA[<p>&#8220;I generally read comments as an excuse for not being able to do something correctly.&#8221;</p>
<p>lol. Where I&#8217;m from we refer to that as a &#8220;stove-pipe&#8221; system. That or a &#8220;duct-taped piece-of-sh*t&#8221;.</p>
<p>Eric: If a client REQUIRES comments (some do) then I tell them that I won&#8217;t add them until AFTER they agree on the software and check off that it is exactly what they want per the scope of the project.  That way I don&#8217;t have to maintain / update comments. In that respect Eric, YOU hit the nail right on the head!</p>
<p>Personally I think the following method is commented enough just by naming conventions and constraints alone.</p>
<p>public static T CalculateMax(T first, T second) where T : IComparable<br />
{<br />
    return second.CompareTo(first) &lt; 0 ? first : second;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dustin</title>
		<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-41</link>
		<dc:creator>Dustin</dc:creator>
		<pubDate>Thu, 23 Aug 2007 00:26:59 +0000</pubDate>
		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-41</guid>
		<description>``// Draw a border around this thumbnail because it’s currently selected.
// Red makes it stand out against the black background, and also matches the client’s color scheme.&#039;&#039;

And what happens to your comment when someone changes the color scheme?

``No matter how you look at it, code is still a “code”… and is no replacement for natural language.&#039;&#039;

I look at it the exact opposite way.  I can actually read code and understand what it&#039;s doing.  People have a very difficult time understand things.  I&#039;d rather see this:

if(element.isSelected()) {
    highlight(element);
}

Than:

// Draw a red box around the selected element.
[imaginary code to find the selected element and position the drawing cursor near it]
this.lineStyle(1, 0xFF0000, 100);
this.moveTo(100, 100);
this.lineTo(200, 100);
this.lineTo(200, 200);
this.lineTo(100, 200);
this.lineTo(100, 100);

I generally read comments as an excuse for not being able to do something correctly.   I certainly *write* them that way.  Browsing through my code you&#039;ll find a lot of what appears to me to be obvious (with documentation comments on public interfaces).  The non-documentation comments describe why I couldn&#039;t make something obvious for whatever reason (broken APIs, performance problems, etc...)

I&#039;ve read many misleading comments in my time, and I&#039;d really just rather not have some English lying to me about code I can already see.</description>
		<content:encoded><![CDATA[<p>&#8220;// Draw a border around this thumbnail because it’s currently selected.<br />
// Red makes it stand out against the black background, and also matches the client’s color scheme.&#8221;</p>
<p>And what happens to your comment when someone changes the color scheme?</p>
<p>&#8220;No matter how you look at it, code is still a “code”… and is no replacement for natural language.&#8221;</p>
<p>I look at it the exact opposite way.  I can actually read code and understand what it&#8217;s doing.  People have a very difficult time understand things.  I&#8217;d rather see this:</p>
<p>if(element.isSelected()) {<br />
    highlight(element);<br />
}</p>
<p>Than:</p>
<p>// Draw a red box around the selected element.<br />
[imaginary code to find the selected element and position the drawing cursor near it]<br />
this.lineStyle(1, 0xFF0000, 100);<br />
this.moveTo(100, 100);<br />
this.lineTo(200, 100);<br />
this.lineTo(200, 200);<br />
this.lineTo(100, 200);<br />
this.lineTo(100, 100);</p>
<p>I generally read comments as an excuse for not being able to do something correctly.   I certainly *write* them that way.  Browsing through my code you&#8217;ll find a lot of what appears to me to be obvious (with documentation comments on public interfaces).  The non-documentation comments describe why I couldn&#8217;t make something obvious for whatever reason (broken APIs, performance problems, etc&#8230;)</p>
<p>I&#8217;ve read many misleading comments in my time, and I&#8217;d really just rather not have some English lying to me about code I can already see.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: If the code and the comments disagree, then both are probably wrong &#171; Charismatic Megafauna</title>
		<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-38</link>
		<dc:creator>If the code and the comments disagree, then both are probably wrong &#171; Charismatic Megafauna</dc:creator>
		<pubDate>Wed, 22 Aug 2007 05:16:28 +0000</pubDate>
		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-38</guid>
		<description>[...] recently wrote some code commenting guidelines to explain why comments are usually a Good Thing. Some intelligent and good looking people agreed [...]</description>
		<content:encoded><![CDATA[<p>[...] recently wrote some code commenting guidelines to explain why comments are usually a Good Thing. Some intelligent and good looking people agreed [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-37</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Tue, 21 Aug 2007 21:46:55 +0000</pubDate>
		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-37</guid>
		<description>&quot;Code should be written in a way that doesn’t require commenting.&quot;

Will, you hit the nail on the head.  Comments are never an acceptable substitute for well-written readable code.  I would even go the extra mile to write less efficient / easily comprehensible / easily maintainable code than to have an extremely code-efficient piece of code that nobody can understand.

The most useful commenting that anyone can do is to choose your method names and member names descriptively and carefully.

Comments are useful to explain non-obvious techniques, and to give a short, general purpose statement for a piece of code -- the fewer the comments required the better.

The inherent problem with comments is that they can never be tested.  Code can be tested, but comments cannot.  Once comments are created, they must be maintained along with the code (adding to the burden of software maintenance), or else they will become a liability to the code.  I have inherited code from other developers that did not match the code!  I don&#039;t know if it was just commented incorrectly to begin with, or if the &quot;comment rot&quot; was contributed by people not maintaining the comments after software changes were made.</description>
		<content:encoded><![CDATA[<p>&#8220;Code should be written in a way that doesn’t require commenting.&#8221;</p>
<p>Will, you hit the nail on the head.  Comments are never an acceptable substitute for well-written readable code.  I would even go the extra mile to write less efficient / easily comprehensible / easily maintainable code than to have an extremely code-efficient piece of code that nobody can understand.</p>
<p>The most useful commenting that anyone can do is to choose your method names and member names descriptively and carefully.</p>
<p>Comments are useful to explain non-obvious techniques, and to give a short, general purpose statement for a piece of code &#8212; the fewer the comments required the better.</p>
<p>The inherent problem with comments is that they can never be tested.  Code can be tested, but comments cannot.  Once comments are created, they must be maintained along with the code (adding to the burden of software maintenance), or else they will become a liability to the code.  I have inherited code from other developers that did not match the code!  I don&#8217;t know if it was just commented incorrectly to begin with, or if the &#8220;comment rot&#8221; was contributed by people not maintaining the comments after software changes were made.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff</title>
		<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-36</link>
		<dc:creator>Geoff</dc:creator>
		<pubDate>Tue, 21 Aug 2007 20:09:58 +0000</pubDate>
		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-36</guid>
		<description>No matter how you look at it, code is still a &quot;code&quot;... and is no replacement for natural language.  Even when I come back to do some maintenance on my code months after the fact, I don&#039;t want to have to sit there and translate a bunch of C# to my original intent.  I want to be able to scan the comments to understand the logic.  It&#039;s MUCH quicker that way.

I agree with the basic approach that you should always succinctly comment your intent.  In my experience, I  find that if a developer can&#039;t &quot;touch-type&quot; they&#039;re less likely to comment their work.

Also, on one project I did I received very positive feedback from a happy client that was something to the effect of &quot;I don&#039;t know C#, but I could understand what was going on.&quot;

Commenting now is all about future productivity.</description>
		<content:encoded><![CDATA[<p>No matter how you look at it, code is still a &#8220;code&#8221;&#8230; and is no replacement for natural language.  Even when I come back to do some maintenance on my code months after the fact, I don&#8217;t want to have to sit there and translate a bunch of C# to my original intent.  I want to be able to scan the comments to understand the logic.  It&#8217;s MUCH quicker that way.</p>
<p>I agree with the basic approach that you should always succinctly comment your intent.  In my experience, I  find that if a developer can&#8217;t &#8220;touch-type&#8221; they&#8217;re less likely to comment their work.</p>
<p>Also, on one project I did I received very positive feedback from a happy client that was something to the effect of &#8220;I don&#8217;t know C#, but I could understand what was going on.&#8221;</p>
<p>Commenting now is all about future productivity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ciz</title>
		<link>http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-35</link>
		<dc:creator>Ciz</dc:creator>
		<pubDate>Tue, 21 Aug 2007 04:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/#comment-35</guid>
		<description>Will - I almost agree.  Perfectly designed and refactored code shouldn&#039;t need much further explanation to describe *what* it&#039;s doing, because you can infer that from accurate and carefully chosen names.  However, none of this helps you understand *why* the original programmer made certain design choices or assumptions.</description>
		<content:encoded><![CDATA[<p>Will &#8211; I almost agree.  Perfectly designed and refactored code shouldn&#8217;t need much further explanation to describe *what* it&#8217;s doing, because you can infer that from accurate and carefully chosen names.  However, none of this helps you understand *why* the original programmer made certain design choices or assumptions.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
