<?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>So Jake Says &#187; critical thinking</title>
	<atom:link href="http://www.jakevoytko.com/blog/tag/critical-thinking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jakevoytko.com/blog</link>
	<description>Ye Olde Computer Science Blogge</description>
	<lastBuildDate>Sun, 17 Jan 2010 15:16:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Reading Comprehension Will Make You A Better Programmer</title>
		<link>http://www.jakevoytko.com/blog/2007/12/22/reading-comprehension-will-make-you-a-better-programmer/</link>
		<comments>http://www.jakevoytko.com/blog/2007/12/22/reading-comprehension-will-make-you-a-better-programmer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 16:00:19 +0000</pubDate>
		<dc:creator>Jake</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[critical thinking]]></category>
		<category><![CDATA[Reading Code]]></category>
		<category><![CDATA[Reading comprehension]]></category>

		<guid isPermaLink="false">http://www.jakevoytko.com/blog/2007/12/22/reading-comprehension-will-make-you-a-better-programmer/</guid>
		<description><![CDATA[The Problem Reading will always be hard. Always. When we read books, we don&#8217;t notice just how damn hard it is because we are reading at such a high level. For example, when I read a classic novel, I think of themes and motifs on a broad scale. I completely miss most details in the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The Problem</strong></p>
<p>Reading will always be hard. Always. When we read books, we don&#8217;t notice just how damn hard it is because we are reading at such a high level. For example, when I read a classic novel, I think of themes and motifs on a broad scale. I completely miss most details in the phrasing, and you can forget about obscure literary references. I&#8217;m not intentionally skipping over these things. I&#8217;m not reading as if every sentence matters.</p>
<p>It takes a seasoned literature veteran to extract the detail work from novels that were written by seasoned veterans. To the rest of us, &#8220;Moby Dick&#8221; may as well be &#8220;Snow Crash&#8221;.</p>
<p>Code is different. Every line has important details that are needed to understand what is going on. <strong>Code must be read closer than you&#8217;ve ever read a novel</strong>, and that level of tedium is just too much for some. As Joel Spolsky puts it in his post &#8220;<a href="http://www.joelonsoftware.com/articles/fog0000000069.html">Things You Should Never Do, Part I</a>&#8220;:</p>
<blockquote><p>There&#8217;s a subtle reason that programmers always want to throw away the code and start over. The reason is that they think the old code is a mess. And here is the interesting observation: <em>they are probably wrong.</em> The reason that they think the old code is a mess is because of a cardinal, fundamental law of programming:</p>
<blockquote><p><strong>It&#8217;s harder to read code than to write it.</strong></p></blockquote>
<p>This is why code reuse is so hard. This is why everybody on your team has a different function they like to use for splitting strings into arrays of strings. They write their own function because it&#8217;s easier and more fun than figuring out how the old function works.</p></blockquote>
<p><strong>The Solution</strong></p>
<p>So how do we deal with the tedious task of reading code? By reading code. As with all things, the more you work at it, the better you will get at it. Don&#8217;t shy away from a code example just because it is written in another language. Pull out the reference and get yourself learning. It can only help you in the end.</p>
<p>As with all things, practice doesn&#8217;t work if you don&#8217;t practice the right way. Many of us have been exposed to reading comprehension techniques along the way. There are many different ways to go about this process, but I&#8217;ll stick with the mythical Levels of Reading Comprehension.<br />
<a name="levels"></a></p>
<blockquote><p><strong>Levels of Reading Comprehension</strong></p>
<ul>
<li><strong>Level Zero:</strong> Don&#8217;t read the text, and form a strong opinion from the title (reserved for advanced Internet users and high school dropouts).</li>
<li><strong>Level One:</strong> Literal.</li>
<li> <strong>Level Two:</strong> Interpretive.</li>
<li> <strong>Level Three</strong>: Applied.</li>
</ul>
</blockquote>
<p>The Level One details for code are the implementation details: &#8220;what is the interface?&#8221; &#8220;What language is it written in?&#8221; &#8220;What data structures are being utilized?&#8221; Piecing together all Level One information on a piece of code essentially outlines the algorithm, much as having all Level One information on a book gives you the plot. You can essentially view this as the quantitative information that the code has to provide.</p>
<p>On the other hand, Level Two questions are where you begin to judge the qualitative nature of the code. &#8220;Why was this algorithm chosen?&#8221; &#8220;What tradeoffs were made in this design?&#8221; &#8220;Is there a way that this could be done more efficiently?&#8221; &#8220;Could a different data structure have been used?&#8221;</p>
<p>Writing is also hard, and you&#8217;ll find plenty of instances where the authors come up short. The burden is on you to prove beyond a shadow of a doubt that you&#8217;re right and the author is wrong. If you&#8217;re not bending over backwards to try to say &#8220;well, maybe the author was using it in the context of..&#8221;, you&#8217;re not giving them much credit, and might not be putting enough thought into the process. When you find yourself saying &#8220;this code is awful!&#8221;, try thinking of how you would do it yourself. Sometimes you find that you come up with a better way than the author. Sometimes you&#8217;re led right back to the same solution as the author.</p>
<p>Level Three is where we can find the strongest lessons, and ask the deepest questions. When can I use this algorithm? When should I modify it? Why should this implementation be obvious, given the problem description?</p>
<p>This is where a programmer&#8217;s critical thinking skills will shine.</p>
<p>Granted, it&#8217;s difficult to determine the ramifications of question such as, &#8220;What would the impact of using this non-standard syntax be if I made 300,000 library users adopt it?&#8221;. However, thinking on such a big scale can only help you as a programmer, and the bigger you think, the more you help yourself.</p>
<p><strong>Other Examples</strong></p>
<p>There is a lot of precedent in the Maths and Sciences to use this kind of Level Three critical thinking. To list a few examples, in &#8220;<a href="http://www.cs.virginia.edu/~robins/YouAndYourResearch.html">You and Your Research</a>&#8220;, Richard Hamming (after whom half of the natural world is named) goes into great detail about how the aspiring researcher should arrange his or her thoughts in order to produce great research. He decides that only by setting aside time to ask yourself deep, analytical, important thoughts can you ever produce great things.</p>
<p>In &#8220;<a href="http://www.stephenwolfram.com/publications/talks/feynman/">A Short Talk about Richard Feynman</a>&#8220;, Stephen Wolfram notes:</p>
<blockquote><p>&#8220;But wherever one could go with that, Feynman could go. Like no one else.</p>
<p>I always found it incredible. He would start with some problem, and fill up pages with calculations. And at the end of it, he would actually get the right answer!</p>
<p>But he usually wasn&#8217;t satisfied with that. Once he&#8217;d got the answer, he&#8217;d go back and try to figure out why it was obvious.&#8221;</p>
<p>And often he&#8217;d come up with one of those classic Feynman straightforward-sounding explanations. And he&#8217;d never tell people about all the calculations behind it. Sometimes it was kind of a game for him: having people be flabbergasted by his seemingly instant physical intuition. Not knowing that really it was based on some long, hard calculation he&#8217;d done.</p>
<p>He always had a fantastic formal intuition about the innards of his calculations. Knowing what kind of result some integral should have, whether some special case should matter, and so on.</p>
<p>And he was always trying to sharpen his intuition.&#8221;</p></blockquote>
<p>Granted, Feynman and Hamming weren&#8217;t reading the work of others, they were interpreting their own work. However, programming provides plenty of opportunities to ask yourself these kind of deep analytical questions. You just need to know the right questions to ask.</p>
<img src="http://www.jakevoytko.com/blog/?ak_action=api_record_view&id=27&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.jakevoytko.com/blog/2007/12/22/reading-comprehension-will-make-you-a-better-programmer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
