<?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: Comments are evil?</title>
	<atom:link href="http://www.makinggoodsoftware.com/2009/06/06/comments-are-evil/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.makinggoodsoftware.com/2009/06/06/comments-are-evil/</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 13:13:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Alberto Gutierrez</title>
		<link>http://www.makinggoodsoftware.com/2009/06/06/comments-are-evil/comment-page-1/#comment-9098</link>
		<dc:creator>Alberto Gutierrez</dc:creator>
		<pubDate>Thu, 24 Jun 2010 19:27:51 +0000</pubDate>
		<guid isPermaLink="false">http://makinggoodsoftware.com/?p=436#comment-9098</guid>
		<description>Hi Achim!

Thanks for your comment, you indeed highlight a lot of points that make a lot of sense... Actually, I have to admit that reading again the article it does sound too extremistic, I really think you are right, there is times when a comment is necessary...

Thanks for your great feedback!!!</description>
		<content:encoded><![CDATA[<p>Hi Achim!</p>
<p>Thanks for your comment, you indeed highlight a lot of points that make a lot of sense&#8230; Actually, I have to admit that reading again the article it does sound too extremistic, I really think you are right, there is times when a comment is necessary&#8230;</p>
<p>Thanks for your great feedback!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Achim</title>
		<link>http://www.makinggoodsoftware.com/2009/06/06/comments-are-evil/comment-page-1/#comment-9077</link>
		<dc:creator>Achim</dc:creator>
		<pubDate>Thu, 24 Jun 2010 06:17:18 +0000</pubDate>
		<guid isPermaLink="false">http://makinggoodsoftware.com/?p=436#comment-9077</guid>
		<description>Hi Alberto,

thanks for the interesting articles in your blog. For this article, however, I have to disagree. I think most of us all know this viewpoint from some kind of Agile-Book, but I think it&#039;s just so plain wrong. Wynia has already said some wise words about comments. Sometimes they just can&#039;t be let out to make the &quot;why&quot; clear.

There&#039;s some other aspect I want to make clear about commenting code: At least interfaces should ALWAYS be documented thoroughly to make their contract and intention clear. It&#039;s exactly that thing - the missing contract - that sometimes gives me a hard time, when faced with a method, used a dozen of times in the code but not working like expected. Now in that case it would have really helped to know HOW the method was expected to behave...

Another point about comments is, like Basu stated already, that they make you think about your code. Don&#039;t underestimate that fact!

About the &quot;out of sync&quot;-problem: Sorry, but I think that&#039;s really a problem that doesn&#039;t lie in the comments but in the laziness of the developer...

As a last thing: Imagine the J2SE or J2EE libraries without their thorough documentation: Now is that crappy code? I wonder what the people of the &quot;Comments indicate bad code&quot;-fraction will do if they once more stumble upon a really sparse documented Open-Source-Library. In my mind I can already hear them rejoyce because they once more found a piece of software that&#039;s so great that it doesn&#039;t need any comments. Get my point? :)

Greate article about that subject from Brian Goetz: http://www.ibm.com/developerworks/java/library/j-jtp0821.html</description>
		<content:encoded><![CDATA[<p>Hi Alberto,</p>
<p>thanks for the interesting articles in your blog. For this article, however, I have to disagree. I think most of us all know this viewpoint from some kind of Agile-Book, but I think it&#8217;s just so plain wrong. Wynia has already said some wise words about comments. Sometimes they just can&#8217;t be let out to make the &#8220;why&#8221; clear.</p>
<p>There&#8217;s some other aspect I want to make clear about commenting code: At least interfaces should ALWAYS be documented thoroughly to make their contract and intention clear. It&#8217;s exactly that thing &#8211; the missing contract &#8211; that sometimes gives me a hard time, when faced with a method, used a dozen of times in the code but not working like expected. Now in that case it would have really helped to know HOW the method was expected to behave&#8230;</p>
<p>Another point about comments is, like Basu stated already, that they make you think about your code. Don&#8217;t underestimate that fact!</p>
<p>About the &#8220;out of sync&#8221;-problem: Sorry, but I think that&#8217;s really a problem that doesn&#8217;t lie in the comments but in the laziness of the developer&#8230;</p>
<p>As a last thing: Imagine the J2SE or J2EE libraries without their thorough documentation: Now is that crappy code? I wonder what the people of the &#8220;Comments indicate bad code&#8221;-fraction will do if they once more stumble upon a really sparse documented Open-Source-Library. In my mind I can already hear them rejoyce because they once more found a piece of software that&#8217;s so great that it doesn&#8217;t need any comments. Get my point? <img src='http://www.makinggoodsoftware.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Greate article about that subject from Brian Goetz: <a href="http://www.ibm.com/developerworks/java/library/j-jtp0821.html" rel="nofollow">http://www.ibm.com/developerworks/java/library/j-jtp0821.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Why comments are evil&#8230; &#124; satukubik</title>
		<link>http://www.makinggoodsoftware.com/2009/06/06/comments-are-evil/comment-page-1/#comment-6757</link>
		<dc:creator>Why comments are evil&#8230; &#124; satukubik</dc:creator>
		<pubDate>Thu, 22 Apr 2010 07:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://makinggoodsoftware.com/?p=436#comment-6757</guid>
		<description>[...] heard a lot of times that comments are considered as an evil. And yet we always found a way to say, &#8216;but in [...]</description>
		<content:encoded><![CDATA[<p>[...] heard a lot of times that comments are considered as an evil. And yet we always found a way to say, &#8216;but in [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tseliso</title>
		<link>http://www.makinggoodsoftware.com/2009/06/06/comments-are-evil/comment-page-1/#comment-739</link>
		<dc:creator>Tseliso</dc:creator>
		<pubDate>Fri, 07 Aug 2009 06:34:41 +0000</pubDate>
		<guid isPermaLink="false">http://makinggoodsoftware.com/?p=436#comment-739</guid>
		<description>The biggest overhead of repeating &quot;code&quot; is when you have to repeat the effort of maintaining the code and the repeat of the code, in this case comments.  

Having code with less repeats -the same principle behind generic usable code- avoids this overhead and avoids having situations where the duplication goes out of synch.

Imagine how confusing comments that are out synch with the actual code can be.</description>
		<content:encoded><![CDATA[<p>The biggest overhead of repeating &#8220;code&#8221; is when you have to repeat the effort of maintaining the code and the repeat of the code, in this case comments.  </p>
<p>Having code with less repeats -the same principle behind generic usable code- avoids this overhead and avoids having situations where the duplication goes out of synch.</p>
<p>Imagine how confusing comments that are out synch with the actual code can be.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Svend Tofte</title>
		<link>http://www.makinggoodsoftware.com/2009/06/06/comments-are-evil/comment-page-1/#comment-191</link>
		<dc:creator>Svend Tofte</dc:creator>
		<pubDate>Wed, 08 Jul 2009 19:48:25 +0000</pubDate>
		<guid isPermaLink="false">http://makinggoodsoftware.com/?p=436#comment-191</guid>
		<description>People seem to forget that there&#039;s nothing like wrong comments to set you off on a wild goose chase. If the code has no comments, the comments at least cannot be wrong.</description>
		<content:encoded><![CDATA[<p>People seem to forget that there&#8217;s nothing like wrong comments to set you off on a wild goose chase. If the code has no comments, the comments at least cannot be wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Basu</title>
		<link>http://www.makinggoodsoftware.com/2009/06/06/comments-are-evil/comment-page-1/#comment-131</link>
		<dc:creator>Basu</dc:creator>
		<pubDate>Sat, 06 Jun 2009 15:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://makinggoodsoftware.com/?p=436#comment-131</guid>
		<description>I&#039;m afraid I must agree with Wynia. Just the other day I encountered a loop which started iterating over an array from 1 instead of 0 and as a result choked when interacting with client code. I changed it to start from 0 and things seemed to work from 0. The code itself was simple to understand, but I have no way to tell why it was starting from 1 or if I might have broken something else in the process. If the developer was in the habit of always commenting whys he would have paused to think about the start of 1 and written a comment about why it was there. And if it was a mistake, he would have looked over his code to see if it needed explaining and perhaps caught the mistake.
I think we should strive for the right number of comments as opposed to the fewest. It&#039;s better to go a bit overboard than a bit under.</description>
		<content:encoded><![CDATA[<p>I&#8217;m afraid I must agree with Wynia. Just the other day I encountered a loop which started iterating over an array from 1 instead of 0 and as a result choked when interacting with client code. I changed it to start from 0 and things seemed to work from 0. The code itself was simple to understand, but I have no way to tell why it was starting from 1 or if I might have broken something else in the process. If the developer was in the habit of always commenting whys he would have paused to think about the start of 1 and written a comment about why it was there. And if it was a mistake, he would have looked over his code to see if it needed explaining and perhaps caught the mistake.<br />
I think we should strive for the right number of comments as opposed to the fewest. It&#8217;s better to go a bit overboard than a bit under.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J Wynia</title>
		<link>http://www.makinggoodsoftware.com/2009/06/06/comments-are-evil/comment-page-1/#comment-130</link>
		<dc:creator>J Wynia</dc:creator>
		<pubDate>Sat, 06 Jun 2009 15:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://makinggoodsoftware.com/?p=436#comment-130</guid>
		<description>Comments are only a repetition if what you put in them is the &quot;what&quot;. The &quot;what&quot; is, indeed, already there in the form of the code. However, the &quot;why&quot; is often pretty much impossible to put directly into the code itself.

Say you&#039;re faced with some credit card processing code that sends all credit card numbers through validation for the CVV2 (that little number on the signature panel), but there&#039;s this extra bit that sends American Express cards around that particular validation.

The kind of code comment you are talking about being repetitive would say something like:

//Bypassing CVV2 validation for American Express cards.

That comment clearly is redundant because code like this already makes that pretty clear:

if(creditCard.CardType == CardTypes.AmericanExpress)
{

} else
{
isValidCVV2 = creditCard.ValidateCVV2();
}


However, when you&#039;re looking at that code, the question you have in your mind is this:

Q: Why is the code not checking the CVV2 number for American Express cards but *is* checking for the rest?

A: Because American Express wants to come on site and do audits if you check that and the product owner would rather pay the higher rate to process the cards than deal with the audit

That answer is what good comments should contain. That can mean that there are large blocks of code without comments (because the &quot;why&quot; is not necessary), but whenever there ARE comments, they should be explaining the &quot;why&quot;, not the &quot;what&quot;. Then, they aren&#039;t repeating yourself.

&quot;What&quot; comments aren&#039;t necessary. &quot;Why&quot; comments are the lifeblood of a maintainable codebase. They let you go to the people who oversee the credit card processing agreement and see if that &quot;why&quot; still holds true when you&#039;re asked to dig into the credit card validation for other reasons and see if it should be left the way it is.</description>
		<content:encoded><![CDATA[<p>Comments are only a repetition if what you put in them is the &#8220;what&#8221;. The &#8220;what&#8221; is, indeed, already there in the form of the code. However, the &#8220;why&#8221; is often pretty much impossible to put directly into the code itself.</p>
<p>Say you&#8217;re faced with some credit card processing code that sends all credit card numbers through validation for the CVV2 (that little number on the signature panel), but there&#8217;s this extra bit that sends American Express cards around that particular validation.</p>
<p>The kind of code comment you are talking about being repetitive would say something like:</p>
<p>//Bypassing CVV2 validation for American Express cards.</p>
<p>That comment clearly is redundant because code like this already makes that pretty clear:</p>
<p>if(creditCard.CardType == CardTypes.AmericanExpress)<br />
{</p>
<p>} else<br />
{<br />
isValidCVV2 = creditCard.ValidateCVV2();<br />
}</p>
<p>However, when you&#8217;re looking at that code, the question you have in your mind is this:</p>
<p>Q: Why is the code not checking the CVV2 number for American Express cards but *is* checking for the rest?</p>
<p>A: Because American Express wants to come on site and do audits if you check that and the product owner would rather pay the higher rate to process the cards than deal with the audit</p>
<p>That answer is what good comments should contain. That can mean that there are large blocks of code without comments (because the &#8220;why&#8221; is not necessary), but whenever there ARE comments, they should be explaining the &#8220;why&#8221;, not the &#8220;what&#8221;. Then, they aren&#8217;t repeating yourself.</p>
<p>&#8220;What&#8221; comments aren&#8217;t necessary. &#8220;Why&#8221; comments are the lifeblood of a maintainable codebase. They let you go to the people who oversee the credit card processing agreement and see if that &#8220;why&#8221; still holds true when you&#8217;re asked to dig into the credit card validation for other reasons and see if it should be left the way it is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 10 commandments for creating good code &#171; Making Good Software</title>
		<link>http://www.makinggoodsoftware.com/2009/06/06/comments-are-evil/comment-page-1/#comment-129</link>
		<dc:creator>10 commandments for creating good code &#171; Making Good Software</dc:creator>
		<pubDate>Sat, 06 Jun 2009 12:26:27 +0000</pubDate>
		<guid isPermaLink="false">http://makinggoodsoftware.com/?p=436#comment-129</guid>
		<description>[...]      9 comments    &#171; Refactoring: The 5 main questions: Why? When? What? How?&#160;Who? Comments are&#160;evil? [...]</description>
		<content:encoded><![CDATA[<p>[...]      9 comments    &laquo; Refactoring: The 5 main questions: Why? When? What? How?&nbsp;Who? Comments are&nbsp;evil? [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

