<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>silentYak &#187; Code</title>
	<atom:link href="http://www.silentyak.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.silentyak.com</link>
	<description>...a universal platform for global junk...</description>
	<lastBuildDate>Sun, 09 Oct 2011 07:19:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Code Comments, Documentation</title>
		<link>http://www.silentyak.com/2009/12/06/code-comments-documentation/</link>
		<comments>http://www.silentyak.com/2009/12/06/code-comments-documentation/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 22:16:22 +0000</pubDate>
		<dc:creator>RRI</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Documentation]]></category>

		<guid isPermaLink="false">http://www.silentyak.com/?p=983</guid>
		<description><![CDATA[Writing code tends to be harder than it needs to, because there’s a constant need to please a bunch of other people who want to read and understand it. Sometimes, the person who writes the code needs to worry about being able to understand it several months later. Conventional wisdom holds that the solution to [...]]]></description>
			<content:encoded><![CDATA[<p>Writing code tends to be harder than it needs to, because there’s a constant need to please a bunch of other people who want to read and understand it. Sometimes, the person who <em>writes</em> the code needs to worry about being able to understand it several months later.</p>
<p>Conventional wisdom holds that the solution to the problem is documenting the code appropriately. Conventional wisdom is wrong. Reasons are manifold, and quite obvious once you start to think about it.</p>
<p><strong>Documentation is always out-of-date.</strong> It’s impossible to have anyone and everyone who updates code to update the comments and documentation accurately. Sure, you could try, but to a large extent, this is simply beyond your control. Typically, this means you need to assume the documentation is wrong and <em>read the code in detail</em> anyway, so you might as well simply start by reading the code.</p>
<p><strong>Reading the code is the only way to figure out what it is doing.</strong> Documentation only tells you what somebody <em>thinks</em> the code is doing. It is quite possible that they’re wrong, or only partially correct. Besides, it’s better to build up a model of what you think the code is supposed to do, than to be <em>told</em> what to expect.</p>
<p><strong>Code is more concise.</strong> If the code is well-written and self-documented, it is generally faster to read the code and understand what’s going on than to read the comments (which are, by definition, more verbose than the code they attempt to explain). And if you can’t trust the programmer to write good code, you can’t trust the guy to write good documentation either.</p>
<p>There are some situations where documentation <em>is</em> necessary, of course. Examples would be when you are attempting to explain the motivations or structure of your design at a larger scale, or if you want to explain what the code is <em>not</em> — why you decided to something one way and not the other.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silentyak.com/2009/12/06/code-comments-documentation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

