<?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"
	>
<channel>
	<title>Comments on: Successful Strategies for Commenting&#160;Code</title>
	<atom:link href="http://particletree.com/features/successful-strategies-for-commenting-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://particletree.com/features/successful-strategies-for-commenting-code/</link>
	<description>Everyone needs a hug.</description>
	<pubDate>Wed, 19 Nov 2008 12:02:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: links@vp-shops.com</title>
		<link>http://particletree.com/features/successful-strategies-for-commenting-code/#comment-656</link>
		<dc:creator>links@vp-shops.com</dc:creator>
		<pubDate>Fri, 23 Dec 2005 20:57:10 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=92#comment-656</guid>
		<description>&lt;p&gt;Vietnam shopping collections: handmade wood, art culture, handicraft, craft, embroidery, embroidery...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Vietnam shopping collections: handmade wood, art culture, handicraft, craft, embroidery, embroidery&#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: google</title>
		<link>http://particletree.com/features/successful-strategies-for-commenting-code/#comment-655</link>
		<dc:creator>google</dc:creator>
		<pubDate>Sat, 17 Sep 2005 07:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=92#comment-655</guid>
		<description>&lt;p&gt;Interesting, good job&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Interesting, good job</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Roel</title>
		<link>http://particletree.com/features/successful-strategies-for-commenting-code/#comment-654</link>
		<dc:creator>Roel</dc:creator>
		<pubDate>Fri, 02 Sep 2005 12:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=92#comment-654</guid>
		<description>&lt;p&gt;I prefer to go that extra mile and write nearly all of my comments under form of unit tests. That way I know that they are valid. If not they tend to quickly become outdated :-(&lt;/p&gt;

&lt;p&gt;But for the occasional case where I want to put some comment in my code, these tips will be very helpfull indeed.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I prefer to go that extra mile and write nearly all of my comments under form of unit tests. That way I know that they are valid. If not they tend to quickly become outdated :-(</p>

<p>But for the occasional case where I want to put some comment in my code, these tips will be very helpfull indeed.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Wang</title>
		<link>http://particletree.com/features/successful-strategies-for-commenting-code/#comment-653</link>
		<dc:creator>Eric Wang</dc:creator>
		<pubDate>Tue, 30 Aug 2005 10:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=92#comment-653</guid>
		<description>&lt;p&gt;I just wanted to share a technique that works for me. Maybe it'll work for you too. When I build a function, it generally starts something like this:&lt;/p&gt;

&lt;p&gt;function ProcessRequest(Player p, Action a)
{
// Step 1. Validate request
// Step 2. Create local variables
// Step 3. Collect object rules for evaluation
// Step 4. Perform action on Player object
.......
Posted by Joshua Olson · 28 days ago · Link 
It&#8217;s my favorite method when I create functions, BUT, there is a drawback in this method, sometimes when you maintain the fucntion, you must change the inside logic, the step sequence will be crashed, for example, the step3 is removed, then you should modifiy the comments to maintain the readability. Maybe you should go through all the function just to change the step index in the comment, you will hate yourself for the over comment:)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I just wanted to share a technique that works for me. Maybe it&#8217;ll work for you too. When I build a function, it generally starts something like this:</p>

<p>function ProcessRequest(Player p, Action a)
{
// Step 1. Validate request
// Step 2. Create local variables
// Step 3. Collect object rules for evaluation
// Step 4. Perform action on Player object
&#8230;&#8230;.
Posted by Joshua Olson · 28 days ago · Link 
It&#8217;s my favorite method when I create functions, BUT, there is a drawback in this method, sometimes when you maintain the fucntion, you must change the inside logic, the step sequence will be crashed, for example, the step3 is removed, then you should modifiy the comments to maintain the readability. Maybe you should go through all the function just to change the step index in the comment, you will hate yourself for the over comment:)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://particletree.com/features/successful-strategies-for-commenting-code/#comment-652</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Fri, 26 Aug 2005 10:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=92#comment-652</guid>
		<description>&lt;p&gt;Your example code looks like javascript. Javascript code for a production system should of course be commented but stripped out before putting it in the production environment. Forcing your users to download your comments over and over again creates bad performance.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Your example code looks like javascript. Javascript code for a production system should of course be commented but stripped out before putting it in the production environment. Forcing your users to download your comments over and over again creates bad performance.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://particletree.com/features/successful-strategies-for-commenting-code/#comment-651</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Thu, 18 Aug 2005 07:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=92#comment-651</guid>
		<description>&lt;p&gt;All you Hungarian haters really should read the article pointed out by pooly
&lt;a href="http://www.joelonsoftware.com/articles/Wrong.html" rel="nofollow"&gt;http://www.joelonsoftware.com/articles/Wrong.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and the article pointed out by Alex (history of hungarian notation)
&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs600/html/HungaNotat.asp" rel="nofollow"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs600/html/HungaNotat.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;when used as intended it can be very useful.  When used to show that an int is an int - well, its a waste of time.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>All you Hungarian haters really should read the article pointed out by pooly
<a href="http://www.joelonsoftware.com/articles/Wrong.html" rel="nofollow">http://www.joelonsoftware.com/articles/Wrong.html</a></p>

<p>and the article pointed out by Alex (history of hungarian notation)
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs600/html/HungaNotat.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs600/html/HungaNotat.asp</a></p>

<p>when used as intended it can be very useful.  When used to show that an int is an int - well, its a waste of time.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Davee</title>
		<link>http://particletree.com/features/successful-strategies-for-commenting-code/#comment-650</link>
		<dc:creator>Davee</dc:creator>
		<pubDate>Thu, 11 Aug 2005 23:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=92#comment-650</guid>
		<description>&lt;p&gt;Well-written article even though my personal preferences differ from yours.&lt;/p&gt;

&lt;p&gt;As a long-time coder (and occasional PHB :-)), it&#8217;s my experience that any non-trivial code &lt;em&gt;needs&lt;/em&gt; commenting.  Non-trivial in this sense is any code used for more than a couple of months by more than a couple of people or code that ever serves more than its original narrow purpose.&lt;/p&gt;

&lt;p&gt;I worked as a Big-5 consultant for a number of years on a project for a large  US state gov&#8217;t agency.  In that time, the code had (I counted!) 47 sets of hands in it.  Commenting was critical to help us understand a) what the various modules were supposed to do or how they were intended to do it, b) how badly the writer had misinterpreted the voluminous and detailed specs and c) making decisions about refactoring interfaces for a move from client-server to web-based (the comments helped indicate dependencies).&lt;/p&gt;

&lt;p&gt;My current position is the 6th or 7th developer on a commercial product that&#8217;s been around in one form or another for 10+years.  Comments are important to me here b/c I was not around for the design or implementation decisions for the framework I&#8217;m maintaining/extending.&lt;/p&gt;

&lt;p&gt;To those who say &#8216;well-writen code needs no comments&#8217; I say &#8216;read your own crap after a couple of years or a dozen other projects&#8217;.  Unless you are lucky enough to be able to walk away from all not-new-development work, sooner or later you will have to either pick up someone else&#8217;s leavings or you&#8217;ll have a client that wants your months- or years-old code modified.  At that point, having to read code to see what&#8217;s going on will be an expensive indulgence, either in billable hours or time with the family or whatever your value proposition is.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well-written article even though my personal preferences differ from yours.</p>

<p>As a long-time coder (and occasional PHB :-)), it&#8217;s my experience that any non-trivial code <em>needs</em> commenting.  Non-trivial in this sense is any code used for more than a couple of months by more than a couple of people or code that ever serves more than its original narrow purpose.</p>

<p>I worked as a Big-5 consultant for a number of years on a project for a large  US state gov&#8217;t agency.  In that time, the code had (I counted!) 47 sets of hands in it.  Commenting was critical to help us understand a) what the various modules were supposed to do or how they were intended to do it, b) how badly the writer had misinterpreted the voluminous and detailed specs and c) making decisions about refactoring interfaces for a move from client-server to web-based (the comments helped indicate dependencies).</p>

<p>My current position is the 6th or 7th developer on a commercial product that&#8217;s been around in one form or another for 10+years.  Comments are important to me here b/c I was not around for the design or implementation decisions for the framework I&#8217;m maintaining/extending.</p>

<p>To those who say &#8216;well-writen code needs no comments&#8217; I say &#8216;read your own crap after a couple of years or a dozen other projects&#8217;.  Unless you are lucky enough to be able to walk away from all not-new-development work, sooner or later you will have to either pick up someone else&#8217;s leavings or you&#8217;ll have a client that wants your months- or years-old code modified.  At that point, having to read code to see what&#8217;s going on will be an expensive indulgence, either in billable hours or time with the family or whatever your value proposition is.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://particletree.com/features/successful-strategies-for-commenting-code/#comment-649</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Thu, 11 Aug 2005 02:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=92#comment-649</guid>
		<description>&lt;p&gt;I agree with promoting code commenting as a general practice by programmers.  But I also want to echo what Tom said about outdated comments.  If there is one thing worse than comment-less code, it is incorrectly commented code.  I&#8217;ve made the mistake of trusting comments that were no longer true, and paid for it with hours of searching through the code.&lt;/p&gt;

&lt;p&gt;I think comments should be added judiciously so that whoever changes that code in the future would be more likely to update the comments as well.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I agree with promoting code commenting as a general practice by programmers.  But I also want to echo what Tom said about outdated comments.  If there is one thing worse than comment-less code, it is incorrectly commented code.  I&#8217;ve made the mistake of trusting comments that were no longer true, and paid for it with hours of searching through the code.</p>

<p>I think comments should be added judiciously so that whoever changes that code in the future would be more likely to update the comments as well.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://particletree.com/features/successful-strategies-for-commenting-code/#comment-648</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Tue, 09 Aug 2005 21:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=92#comment-648</guid>
		<description>&lt;p&gt;Bravo.  Too many programmers spend little time and apply little thought in making their comments meaningful.  I think you made very important points in terms of style, consistency and readability.&lt;/p&gt;

&lt;p&gt;I don&#8217;t actually code, but often a programer or their manager will print out a section of code for troubleshooting/review.  Having the code properly commented - in a manner similar to what you describe - greatly increases our efficiency as we can become familiar with the logic quickly and leverage the problem solving abilities of some of our non-programmers.  Utilizing proper commenting is the only way that we can effectively do this across platforms and languages. Good read.  I&#8217;m going to forward to my staff as a helpful link.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Bravo.  Too many programmers spend little time and apply little thought in making their comments meaningful.  I think you made very important points in terms of style, consistency and readability.</p>

<p>I don&#8217;t actually code, but often a programer or their manager will print out a section of code for troubleshooting/review.  Having the code properly commented - in a manner similar to what you describe - greatly increases our efficiency as we can become familiar with the logic quickly and leverage the problem solving abilities of some of our non-programmers.  Utilizing proper commenting is the only way that we can effectively do this across platforms and languages. Good read.  I&#8217;m going to forward to my staff as a helpful link.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Joachim S</title>
		<link>http://particletree.com/features/successful-strategies-for-commenting-code/#comment-647</link>
		<dc:creator>Joachim S</dc:creator>
		<pubDate>Mon, 08 Aug 2005 16:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://s2462.gridserver.com/wordpress/?p=92#comment-647</guid>
		<description>&lt;p&gt;Aloha!&lt;/p&gt;

&lt;p&gt;Great article. I&#8217;ve been writing SW code and HW description code (Verilog and VHDL) for years and I have adopted a style that I try to use on all my
source files (with variations based on language rules).&lt;/p&gt;

&lt;p&gt;Basically they boils down to:&lt;/p&gt;

&lt;p&gt;(1) File header AND footer. The footer is basically and
EOF . But I find that it helps greatly, esp when looking at printouts. Header and footer are framed with a row of &#8220;=&#8221; 72 characters in length.&lt;/p&gt;

&lt;p&gt;The header names the file, describes the contents and the purpose of the contents (for example interface module for the design of ASIC XYZ, database class used in the processor model QWERTY etc) any special design considerations, references to design specifications that might be of interest etc. Finally the header ends with author name, copyright and that PHB-stuff. (Yes, I do sign all my work.)&lt;/p&gt;

&lt;p&gt;(2) Framed comments preceeds functions/processes. comments. That is, all functions/processes are preceeded by a comment that describes the intended functionality, pre- and post-conditions, specific code details etc. These comments are framed with a row of &#8220;-&#8221; 68 chars in length.&lt;/p&gt;

&lt;p&gt;(3) Whitespaces. I use blank lines to separate chunks of code within a function, between functions. I use the cosistently with, for example, always two (2) lines between functions.&lt;/p&gt;

&lt;p&gt;(3) Comments within functions preceeds a chunk of code. The comments explains the purpose and any specific detail - reasons for doing a certain thing. (If needed.)&lt;/p&gt;

&lt;p&gt;(4) Use different comment types for comments and code debug. In C/C++ I use &#8220;//&#8221; for all code comments. This allows med to use &#8220;/* .. */&#8221; to comment out blocks of code. Also I can easily spot is a comment is for documentation or not. Languages that don&#8217;t support (at least) two types of comments are quite annoying to work with.&lt;/p&gt;

&lt;p&gt;(5) Code sections are named and divided. I try to layout the contents of the code in a file in a common way. Normally something like:&lt;/p&gt;

&lt;p&gt;(I) Includes and defines
(II) Module interface (if any)
(III) Any global variables (common in HW)
(IV) Storage element allocation and handling
(V) Data flow/manipulation code (fun/process)
(VI) Control flow code&lt;/p&gt;

&lt;p&gt;These sections are are declared and framed off using
a one line section declaration framed with upper- and lowe rows of &#8220;-&#8221; 72 chars long.&lt;/p&gt;

&lt;p&gt;Note that I use 72 chars for headers and sections, and 68 chars for function headers. This allows me to visually see where section ends.&lt;/p&gt;

&lt;p&gt;A brief note on {} (or BEGIN-END). They IMHO should
be alligned together. For example&lt;/p&gt;

&lt;p&gt;void kalle()
{
  do_something();
}&lt;/p&gt;

&lt;p&gt;And when it comes to intendation. Any good editor (i.e. Emacs) allows you to set that it actually produces n number of space characters when you press TAB. Intendation shall be done using space, but you should not need to actually hit that bar that many times - it opens up for errors.&lt;/p&gt;

&lt;p&gt;/Joachim S - ASIC designer at large&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Aloha!</p>

<p>Great article. I&#8217;ve been writing SW code and HW description code (Verilog and VHDL) for years and I have adopted a style that I try to use on all my
source files (with variations based on language rules).</p>

<p>Basically they boils down to:</p>

<p>(1) File header AND footer. The footer is basically and
EOF . But I find that it helps greatly, esp when looking at printouts. Header and footer are framed with a row of &#8220;=&#8221; 72 characters in length.</p>

<p>The header names the file, describes the contents and the purpose of the contents (for example interface module for the design of ASIC XYZ, database class used in the processor model QWERTY etc) any special design considerations, references to design specifications that might be of interest etc. Finally the header ends with author name, copyright and that PHB-stuff. (Yes, I do sign all my work.)</p>

<p>(2) Framed comments preceeds functions/processes. comments. That is, all functions/processes are preceeded by a comment that describes the intended functionality, pre- and post-conditions, specific code details etc. These comments are framed with a row of &#8220;-&#8221; 68 chars in length.</p>

<p>(3) Whitespaces. I use blank lines to separate chunks of code within a function, between functions. I use the cosistently with, for example, always two (2) lines between functions.</p>

<p>(3) Comments within functions preceeds a chunk of code. The comments explains the purpose and any specific detail - reasons for doing a certain thing. (If needed.)</p>

<p>(4) Use different comment types for comments and code debug. In C/C++ I use &#8220;//&#8221; for all code comments. This allows med to use &#8220;/* .. */&#8221; to comment out blocks of code. Also I can easily spot is a comment is for documentation or not. Languages that don&#8217;t support (at least) two types of comments are quite annoying to work with.</p>

<p>(5) Code sections are named and divided. I try to layout the contents of the code in a file in a common way. Normally something like:</p>

<p>(I) Includes and defines
(II) Module interface (if any)
(III) Any global variables (common in HW)
(IV) Storage element allocation and handling
(V) Data flow/manipulation code (fun/process)
(VI) Control flow code</p>

<p>These sections are are declared and framed off using
a one line section declaration framed with upper- and lowe rows of &#8220;-&#8221; 72 chars long.</p>

<p>Note that I use 72 chars for headers and sections, and 68 chars for function headers. This allows me to visually see where section ends.</p>

<p>A brief note on {} (or BEGIN-END). They IMHO should
be alligned together. For example</p>

<p>void kalle()
{
  do_something();
}</p>

<p>And when it comes to intendation. Any good editor (i.e. Emacs) allows you to set that it actually produces n number of space characters when you press TAB. Intendation shall be done using space, but you should not need to actually hit that bar that many times - it opens up for errors.</p>

<p>/Joachim S - ASIC designer at large</p>]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.461 seconds -->
