<?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"
	>

<channel>
	<title>No, Chris!</title>
	<atom:link href="http://nochris.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nochris.com</link>
	<description>I'd rather be sharp than well-rounded.</description>
	<pubDate>Wed, 27 Aug 2008 06:17:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>No more noisy channels</title>
		<link>http://nochris.com/2008/08/26/no-more-noisy-channels/</link>
		<comments>http://nochris.com/2008/08/26/no-more-noisy-channels/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 04:11:04 +0000</pubDate>
		<dc:creator>Chris Lee</dc:creator>
		
		<category><![CDATA[here]]></category>

		<category><![CDATA[idea]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://nochris.com/?p=13</guid>
		<description><![CDATA[A couple years ago I got it into my head that Information Theory held all the answers to the world&#8217;s computing problems.  So, I got this book called The Mathematical Theory of Communication written by Claude Shannon and Warren Weaver.  I was and still am too lazy to go through the math inside [...]]]></description>
			<content:encoded><![CDATA[<p>A couple years ago I got it into my head that Information Theory held all the answers to the world&#8217;s computing problems.  So, I got this book called <em>The Mathematical Theory of Communication</em> written by Claude Shannon and Warren Weaver.  I was and still am too lazy to go through the math inside and really didn&#8217;t and don&#8217;t care much about it, but it&#8217;s old books like these (Shannon&#8217;s original article was published in 1948) that I think should have more impact on new &#8220;technological developments&#8221; or whatever you want to call them.<br />
<span id="more-13"></span></p>
<p>Let&#8217;s reduce the task of writing software to a problem of communication: transferring a message from point A (you) to point B (cpu).  The message is the software&#8217;s high-level specification (source code).  The message is conveyed by the information transmitted from A to B (machine code).</p>
<p>Problems arise when B doesn&#8217;t do what A wants because the source code has bugs.  We&#8217;re all used to this and know how to fix it.  After it&#8217;s fixed the machine code instructs B to do what we want.  But, what else does it do?  Is every instruction necessary?  I&#8217;m not thinking about optimizing instructions for performance, but more about flow control and the logical implications of minimal message passing.  For example, consider this function:<br />
<code><br />
int<br />
ComputeAdditiveOperResult(string oper, int a, int b)<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;if ("add" == oper) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return a + b;<br />
&nbsp;&nbsp;&nbsp;&nbsp;} else if ("subtract" == oper) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return a - b;<br />
&nbsp;&nbsp;&nbsp;&nbsp;} else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw InvalidAdditiveOper();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
</code><br />
The variable <code>oper</code> is used to select one of two useful branches.  The &#8220;third&#8221; branch is essentially an invalid branch.</p>
<p>It only takes 1 bit to communicate which branch should be taken, but many more bits are present in <code>oper</code> because of its type, <code>string</code>.  The <code>oper</code> parameter could have type <code>enum {ADD, SUBTRACT }</code> instead.  Again, this isn&#8217;t about the tiny performance gain you&#8217;d get by comparing one bit instead of many; it&#8217;s about avoiding doing things that aren&#8217;t necessary.</p>
<p>We can all try to practice this, but I think it would be great if it were enforceable.  Consider a programming language that warns you if you don&#8217;t use every bit of information you request.  The function above could produce something like:</p>
<p><code>Warning: parameter 'oper' contains many bits of information, but only 1 bit is necessary</code></p>
<p>Doing it right would be tricky, because if instead of</p>
<p><code>throw InvalidAdditiveOper();</code></p>
<p>it was</p>
<p><code>throw InvalidAdditiveOper(oper);</code></p>
<p>then every bit of <code>oper</code> would be completely used by <code>ComputeAdditiveOperResult</code>, because using a variable as an argument uses every bit of the variable in the current scope.</p>
<p>Character data and such would be fine as long as it were printed or stored, but variables used for flow control could be given strict requirements.  You could probably do this with <code>enum</code>s, but it wouldn&#8217;t be the same.  Realistically, this level of strictness would probably be more annoying than it would be useful, but I think it&#8217;s a good example of a new idea that was inspired by an old, abstract idea.</p>
<p>Read old books or don&#8217;t read any.</p>
]]></content:encoded>
			<wfw:commentRss>http://nochris.com/2008/08/26/no-more-noisy-channels/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why I enjoy using C++</title>
		<link>http://nochris.com/2008/08/12/why-i-enjoy-using-cplusplus/</link>
		<comments>http://nochris.com/2008/08/12/why-i-enjoy-using-cplusplus/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 04:13:50 +0000</pubDate>
		<dc:creator>Chris Lee</dc:creator>
		
		<category><![CDATA[here]]></category>

		<category><![CDATA[c++]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://nochris.com/?p=7</guid>
		<description><![CDATA[I would rather create a circuit that makes an LED turn on than understand the underlying physics enough to be able to design such a circuit and be convinced that, if I actually created it, it would work.  Doing both would probably be better, but that&#8217;s a meaningless (and hopefully obvious) opinion.
In short, I [...]]]></description>
			<content:encoded><![CDATA[<p>I would rather create a circuit that makes an LED turn on than understand the underlying physics enough to be able to design such a circuit and be convinced that, if I actually created it, it would work.  Doing both would probably be better, but that&#8217;s a meaningless (and hopefully obvious) opinion.</p>
<p>In short, I like making things work.  When something breaks, it is fun to fix it.  If it breaks again in the exact same way, it is still fun to fix.  Learning why the problem occurred is only useful because you can use the experience to solve it again.  If you knew for certain that the problem or one releated to it would never occur again, it would not hurt to remove all knowledge of the solution from your memory.  It&#8217;s useless.  Such an isolated problem probably doesn&#8217;t exist, especially if you like to generalize problems, but the point stands.<br />
<span id="more-7"></span></p>
<p>The kind of problems I don&#8217;t like are the ones in which the pain of designing and implementing a mitigation overshadows the pleasure of implementing a solution.  Even if you like fixing cars, if your car breaks down while you&#8217;re driving, you&#8217;re pissed.  You have to get all those tools out and look at a bunch of stuff and who cares what else &#8212; you&#8217;re physically stuck somewhere with a heavy, expensive, immobile piece of whatever it is they use to make cars.  Or, you have to call some random number and explain a bunch of stuff and spend money and you don&#8217;t even get to fix it.</p>
<p>When you&#8217;re programming, unless you&#8217;re editing live code like only rock star web developers do, you rarely have to work hard to mitigate problems.  Sometimes the problem doesn&#8217;t even require mitigation and you can skip right to the solution.  The narrower the scope of your problem, the less mitigation.</p>
<p>Incompatible iterators?  No mitigation.  Trying to dereference a null pointer?  No mitigation (this code isn&#8217;t live, remember).  Syntax error?  How embarrassing, but there&#8217;s no mitigation.  The more a language allows you to shoot yourself in the foot, the more opportunities you have to solve problems that don&#8217;t require mitigation, the more enjoyable it can be to use the language.  C++ allows and encourages you to statically check your balls off, which narrows the scope of your problems, which makes it, for me, a very enjoyable language to use.  Get yourself a good IDE to cut down on text editing and compilation time and you can&#8217;t ask for much more.</p>
]]></content:encoded>
			<wfw:commentRss>http://nochris.com/2008/08/12/why-i-enjoy-using-cplusplus/feed/</wfw:commentRss>
		</item>
		<item>
		<title>File permissions problems? Just make everything globally readable!</title>
		<link>http://nochris.com/2008/08/01/hello-world/</link>
		<comments>http://nochris.com/2008/08/01/hello-world/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 04:13:33 +0000</pubDate>
		<dc:creator>Chris Lee</dc:creator>
		
		<category><![CDATA[here]]></category>

		<category><![CDATA[stupid]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Normally I would feel bad doing
chmod o+r /etc/wordpress/config-nochris.com.php
but when it&#8217;s the magic command to get WordPress working and every other approach I thought of failed, I don&#8217;t care as much.  Besides, I&#8217;m the only user on this server. (right?)
Also, hello.
]]></description>
			<content:encoded><![CDATA[<p>Normally I would feel bad doing</p>
<p><code>chmod o+r /etc/wordpress/config-nochris.com.php</code></p>
<p>but when it&#8217;s the magic command to get WordPress working and every other approach I thought of failed, I don&#8217;t care as much.  Besides, I&#8217;m the only user on this server. (right?)</p>
<p>Also, hello.</p>
]]></content:encoded>
			<wfw:commentRss>http://nochris.com/2008/08/01/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
