<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://commons.oreilly.com/wiki/skins/common/feed.css?97"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>A Comment on Comments - Revision history</title>
		<link>http://commons.oreilly.com/wiki/index.php?title=A_Comment_on_Comments&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.11.0</generator>
		<lastBuildDate>Sun, 19 May 2013 17:06:28 GMT</lastBuildDate>
		<item>
			<title>Kevlin at 11:06, 10 July 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=A_Comment_on_Comments&amp;diff=24772&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 11:06, 10 July 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In my first programming class in college, my teacher handed out two BASIC  coding sheets. On the board, the assignment read &amp;quot;Write a program to input and average 10 bowling scores.&amp;quot; Then the teacher left the room. How hard could this be? I don't remember my final solution but I'm sure it had a &amp;lt;code&amp;gt;FOR&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;NEXT&amp;lt;/code&amp;gt; loop in it and couldn't have been more than 15 lines long total. Coding sheets &amp;amp;mdash; for you kids reading this, yes, we used to write code out longhand before actually entering it into a computer &amp;amp;mdash; allowed for around 70 lines of code each. I was very confused as to why the teacher would have given us two sheets. Since my handwriting has always been atrocious, I used the second one to re-copy my code very neatly, hoping to get a couple extra points for style.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In my first programming class in college, my teacher handed out two BASIC  coding sheets. On the board, the assignment read &amp;quot;Write a program to input and average 10 bowling scores.&amp;quot; Then the teacher left the room. How hard could this be? I don't remember my final solution but I'm sure it had a &amp;lt;code&amp;gt;FOR&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;NEXT&amp;lt;/code&amp;gt; loop in it and couldn't have been more than 15 lines long &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;in &lt;/ins&gt;total. Coding sheets &amp;amp;mdash; for you kids reading this, yes, we used to write code out longhand before actually entering it into a computer &amp;amp;mdash; allowed for around 70 lines of code each. I was very confused as to why the teacher would have given us two sheets. Since my handwriting has always been atrocious, I used the second one to re-copy my code very neatly, hoping to get a couple extra points for style.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Much to my surprise, when I received the assignment back at the start of the next class, I received a barely passing grade. (It was to be an omen to me for the rest of my time in college.) Scrawled across the top of my neatly copied code, &amp;quot;No comments?&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Much to my surprise, when I received the assignment back at the start of the next class, I received a barely passing grade. (It was to be an omen to me for the rest of my time in college.) Scrawled across the top of my neatly copied code, &amp;quot;No comments?&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;It was not enough that the teacher and I both knew what the program was supposed to do. Part of the point of the assignment was to teach me that my code should explain itself to the next programmer coming behind me. It's a lesson I've not forgotten.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;It was not enough that the teacher and I both knew what the program was supposed to do. Part of the point of the assignment was to teach me that my code should explain itself to the next programmer coming behind me. It's a lesson I've not forgotten.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Comments are not evil. They are as necessary to programming as basic branching or looping constructs. Most modern languages have a tool akin to ''javadoc'' that will parse properly formatted comments to automatically build an API document. This is a very good start, but not nearly enough. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Sprinkled inside &lt;/del&gt;your code should be explanations &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;to &lt;/del&gt;what the code is supposed to be doing. Coding by the old adage, &amp;quot;If it was hard to write, it should be hard to read,&amp;quot; does a disservice to your client &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;or &lt;/del&gt;employer.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Comments are not evil. They are as necessary to programming as basic branching or looping constructs. Most modern languages have a tool akin to ''javadoc'' that will parse properly formatted comments to automatically build an API document. This is a very good start, but not nearly enough. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Inside &lt;/ins&gt;your code should be explanations &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;about &lt;/ins&gt;what the code is supposed to be doing. Coding by the old adage, &amp;quot;If it was hard to write, it should be hard to read,&amp;quot; does a disservice to your client&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, your &lt;/ins&gt;employer&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, your colleagues, and your future self&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;On the other hand, you can go too far in your commenting. Make sure that your comments clarify your code but do not obscure it. Sprinkle your code with relevant comments explaining what the code is supposed to accomplish. Your header comments should give any programmer enough information to use your code without having to read it while your in-line comments should assist the next developer in fixing or extending it. &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;On the other hand, you can go too far in your commenting. Make sure that your comments clarify your code but do not obscure it. Sprinkle your code with relevant comments explaining what the code is supposed to accomplish. Your header comments should give any programmer enough information to use your code without having to read it while your in-line comments should assist the next developer in fixing or extending it. &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;At one job, I disagreed with a design decision made by those above me. Feeling rather snarky, as young programmers often do, I pasted the text of the email instructing me to use their design into the header comment block of the file. It turns out that managers at this particular shop actually &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;review &lt;/del&gt;the code &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;as &lt;/del&gt;it&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'s &lt;/del&gt;committed. It was my first introduction to the term ''career-limiting move''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;At one job, I disagreed with a design decision made by those above me. Feeling rather snarky, as young programmers often do, I pasted the text of the email instructing me to use their design into the header comment block of the file. It turns out that managers at this particular shop actually &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;reviewed &lt;/ins&gt;the code &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;when &lt;/ins&gt;it &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;was &lt;/ins&gt;committed. It was my first introduction to the term ''career-limiting move''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;by [[Cal Evans]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;by [[Cal Evans]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:23281:newid:24772 --&gt;
&lt;/table&gt;</description>
			<pubDate>Fri, 10 Jul 2009 11:06:20 GMT</pubDate>			<dc:creator>Kevlin</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:A_Comment_on_Comments</comments>		</item>
		<item>
			<title>Kevlin at 12:33, 4 February 2009</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=A_Comment_on_Comments&amp;diff=23281&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 12:33, 4 February 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;It was not enough that the teacher and I both knew what the program was supposed to do. Part of the point of the assignment was to teach me that my code should explain itself to the next programmer coming behind me. It's a lesson I've not forgotten.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;It was not enough that the teacher and I both knew what the program was supposed to do. Part of the point of the assignment was to teach me that my code should explain itself to the next programmer coming behind me. It's a lesson I've not forgotten.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Comments are not evil. They are as necessary to programming as basic branching or looping constructs. Most modern languages have a tool akin to &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;&lt;/del&gt;javadoc&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/code&amp;gt; &lt;/del&gt;that will parse properly formatted comments to automatically build an API document. This is a very good start, but not nearly enough. Sprinkled inside your code should be explanations to what the code is supposed to be doing. Coding by the old adage, &amp;quot;If it was hard to write, it should be hard to read,&amp;quot; does a disservice to your client or employer.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Comments are not evil. They are as necessary to programming as basic branching or looping constructs. Most modern languages have a tool akin to &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/ins&gt;javadoc&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;'' &lt;/ins&gt;that will parse properly formatted comments to automatically build an API document. This is a very good start, but not nearly enough. Sprinkled inside your code should be explanations to what the code is supposed to be doing. Coding by the old adage, &amp;quot;If it was hard to write, it should be hard to read,&amp;quot; does a disservice to your client or employer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;On the other hand, you can go too far in your commenting. Make sure that your comments clarify your code but not obscure it. Sprinkle your code with relevant comments explaining what the code is supposed to accomplish. Your header comments should give any programmer enough information to use your code without having to read it while your in-line comments should assist the next developer in fixing or extending it. &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;On the other hand, you can go too far in your commenting. Make sure that your comments clarify your code but &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;do &lt;/ins&gt;not obscure it. Sprinkle your code with relevant comments explaining what the code is supposed to accomplish. Your header comments should give any programmer enough information to use your code without having to read it while your in-line comments should assist the next developer in fixing or extending it. &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;At one job, I disagreed with a design decision made by those above me. Feeling rather snarky, as young programmers often do, I pasted the text of the email instructing me to use their design into the header comment block of the file. It turns out that managers at this particular shop actually review the code as it's committed. It was my first introduction to the term ''&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Career&lt;/del&gt;-&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Limiting Move&lt;/del&gt;''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;At one job, I disagreed with a design decision made by those above me. Feeling rather snarky, as young programmers often do, I pasted the text of the email instructing me to use their design into the header comment block of the file. It turns out that managers at this particular shop actually review the code as it's committed. It was my first introduction to the term ''&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;career&lt;/ins&gt;-&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;limiting move&lt;/ins&gt;''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;by [[Cal Evans]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;by [[Cal Evans]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:22874:newid:23281 --&gt;
&lt;/table&gt;</description>
			<pubDate>Wed, 04 Feb 2009 12:33:10 GMT</pubDate>			<dc:creator>Kevlin</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:A_Comment_on_Comments</comments>		</item>
		<item>
			<title>Calevans at 15:39, 22 December 2008</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=A_Comment_on_Comments&amp;diff=22874&amp;oldid=prev</link>
			<description>&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:39, 22 December 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;On the other hand, you can go too far in your commenting. Make sure that your comments clarify your code but not obscure it. Sprinkle your code with relevant comments explaining what the code is supposed to accomplish. Your header comments should give any programmer enough information to use your code without having to read it while your in-line comments should assist the next developer in fixing or extending it. &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;On the other hand, you can go too far in your commenting. Make sure that your comments clarify your code but not obscure it. Sprinkle your code with relevant comments explaining what the code is supposed to accomplish. Your header comments should give any programmer enough information to use your code without having to read it while your in-line comments should assist the next developer in fixing or extending it. &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;At one job, I disagreed with a design decision made by those above me. Feeling rather snarky, as young programmers often do, I pasted the text of the email instructing me to use &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;this &lt;/del&gt;design into the header comment block of the file. It turns out that managers at this particular shop actually review the code as it's committed. It was my first introduction to the term ''Career-Limiting Move''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;At one job, I disagreed with a design decision made by those above me. Feeling rather snarky, as young programmers often do, I pasted the text of the email instructing me to use &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;their &lt;/ins&gt;design into the header comment block of the file. It turns out that managers at this particular shop actually review the code as it's committed. It was my first introduction to the term ''Career-Limiting Move''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;by [[Cal Evans]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;by [[Cal Evans]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:22869:newid:22874 --&gt;
&lt;/table&gt;</description>
			<pubDate>Mon, 22 Dec 2008 15:39:37 GMT</pubDate>			<dc:creator>Calevans</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:A_Comment_on_Comments</comments>		</item>
		<item>
			<title>Calevans: New page: In my first programming class in college, my teacher handed out two BASIC  coding sheets. On the board, the assignment read &quot;Write a program to input and average 10 bowling scores.&quot; Then t...</title>
			<link>http://commons.oreilly.com/wiki/index.php?title=A_Comment_on_Comments&amp;diff=22869&amp;oldid=prev</link>
			<description>&lt;p&gt;New page: In my first programming class in college, my teacher handed out two BASIC  coding sheets. On the board, the assignment read &amp;quot;Write a program to input and average 10 bowling scores.&amp;quot; Then t...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In my first programming class in college, my teacher handed out two BASIC  coding sheets. On the board, the assignment read &amp;quot;Write a program to input and average 10 bowling scores.&amp;quot; Then the teacher left the room. How hard could this be? I don't remember my final solution but I'm sure it had a &amp;lt;code&amp;gt;FOR&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;NEXT&amp;lt;/code&amp;gt; loop in it and couldn't have been more than 15 lines long total. Coding sheets &amp;amp;mdash; for you kids reading this, yes, we used to write code out longhand before actually entering it into a computer &amp;amp;mdash; allowed for around 70 lines of code each. I was very confused as to why the teacher would have given us two sheets. Since my handwriting has always been atrocious, I used the second one to re-copy my code very neatly, hoping to get a couple extra points for style.&lt;br /&gt;
&lt;br /&gt;
Much to my surprise, when I received the assignment back at the start of the next class, I received a barely passing grade. (It was to be an omen to me for the rest of my time in college.) Scrawled across the top of my neatly copied code, &amp;quot;No comments?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
It was not enough that the teacher and I both knew what the program was supposed to do. Part of the point of the assignment was to teach me that my code should explain itself to the next programmer coming behind me. It's a lesson I've not forgotten.&lt;br /&gt;
&lt;br /&gt;
Comments are not evil. They are as necessary to programming as basic branching or looping constructs. Most modern languages have a tool akin to &amp;lt;code&amp;gt;javadoc&amp;lt;/code&amp;gt; that will parse properly formatted comments to automatically build an API document. This is a very good start, but not nearly enough. Sprinkled inside your code should be explanations to what the code is supposed to be doing. Coding by the old adage, &amp;quot;If it was hard to write, it should be hard to read,&amp;quot; does a disservice to your client or employer.&lt;br /&gt;
&lt;br /&gt;
On the other hand, you can go too far in your commenting. Make sure that your comments clarify your code but not obscure it. Sprinkle your code with relevant comments explaining what the code is supposed to accomplish. Your header comments should give any programmer enough information to use your code without having to read it while your in-line comments should assist the next developer in fixing or extending it. &lt;br /&gt;
&lt;br /&gt;
At one job, I disagreed with a design decision made by those above me. Feeling rather snarky, as young programmers often do, I pasted the text of the email instructing me to use this design into the header comment block of the file. It turns out that managers at this particular shop actually review the code as it's committed. It was my first introduction to the term ''Career-Limiting Move''.&lt;br /&gt;
&lt;br /&gt;
by [[Cal Evans]]&lt;br /&gt;
&lt;br /&gt;
This work is licensed under a&lt;br /&gt;
[http://creativecommons.org/licenses/by/3.0/us/ Creative Commons Attribution 3] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Back to [[97 Things Every Programmer Should Know]] home page&lt;/div&gt;</description>
			<pubDate>Sun, 21 Dec 2008 09:26:53 GMT</pubDate>			<dc:creator>Calevans</dc:creator>			<comments>http://commons.oreilly.com/wiki/index.php/Talk:A_Comment_on_Comments</comments>		</item>
	</channel>
</rss>