<?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>Adam Jon R.</title>
	<atom:link href="http://adamjonrichardson.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://adamjonrichardson.com</link>
	<description>Obscurity by Security, and Other Techitudes</description>
	<lastBuildDate>Tue, 28 Aug 2012 05:18:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Some people are very, very, very selective when they quote Knuth</title>
		<link>http://adamjonrichardson.com/2012/08/28/some-people-are-very-very-very-selective-when-they-quote-knuth/</link>
		<comments>http://adamjonrichardson.com/2012/08/28/some-people-are-very-very-very-selective-when-they-quote-knuth/#comments</comments>
		<pubDate>Tue, 28 Aug 2012 02:44:09 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Algorithms]]></category>

		<guid isPermaLink="false">http://adamjonrichardson.com/?p=137</guid>
		<description><![CDATA[People who selectively quote Knuth as saying, &#8220;premature optimization is the root of all evil,&#8221; when they speak of how cheap hardware is and how wasteful a particular performance improvement is might have missed a tome, or 2, or 3,...]]></description>
				<content:encoded><![CDATA[<p>People who selectively quote Knuth as saying, &#8220;premature optimization is the root of all evil,&#8221; when they speak of how cheap hardware is and how wasteful a particular performance improvement is might have missed a tome, or 2, or 3, or 4 of his covering algorithms <img src='http://adamjonrichardson.com/the-wp-7788/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://adamjonrichardson.com/2012/08/28/some-people-are-very-very-very-selective-when-they-quote-knuth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Long Live the GOTO Statement</title>
		<link>http://adamjonrichardson.com/2012/02/06/long-live-the-goto-statement/</link>
		<comments>http://adamjonrichardson.com/2012/02/06/long-live-the-goto-statement/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 07:35:25 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming Language Design]]></category>

		<guid isPermaLink="false">http://adamjonrichardson.com/?p=86</guid>
		<description><![CDATA[Introduction: Infamous GOTO Sure, since Dijkstra&#8217;s letter outlining the harmful aspects of the goto statement, few have voiced even modest amounts of tolerance for the statement, let alone condoned it&#8217;s use. Even those who&#8217;ve described practical uses of the goto...]]></description>
				<content:encoded><![CDATA[<h2>Introduction: Infamous GOTO</h2>
<p>Sure, since <a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD215.html">Dijkstra&#8217;s letter outlining the harmful aspects of the goto statement</a>, few have voiced even modest amounts of tolerance for the statement, let alone condoned it&#8217;s use. Even those who&#8217;ve described practical uses of the goto statement have questioned its existence in higher level languages (e.g., although <a href="http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf">Donald Knuth noted some utility for goto</a>, he also suggested that he would likely never use it in a language that had sufficiently capable iteration and event constructs.)</p>
<p>Today you can find a myriad of online resources that set the goto statement ablaze. The <a href="http://php.net/releases/5_3_0.php">5.3 release of PHP provided a unique look at the perception of the goto statement</a>, as prior to that release, PHP lacked <span id="more-86"></span> the statement. It&#8217;s one thing to work with languages that have grandfathered in the statement but deprecated its use, but adding goto to a language that lacked the construct fueled the flames of a thousand suns.</p>
<p>However, even Dijkstra was careful to limit his critique to the basic form of the goto statement prevalent during that era of programming:</p>
<blockquote><p>The <strong>go to</strong> statement as it stands is just too primitive, it is too much an invitation to make a mess of one&#8217;s program.</p></blockquote>
<p>So, what could the goto statement possibly do to benefit today&#8217;s programmers? Even though <a href="http://en.wikipedia.org/wiki/Structured_program_theorem">we don&#8217;t need the goto statement to implement our programs</a>, does that mean we can&#8217;t benefit from its thoughtful use?</p>
<h2>Hypothesis: GOTO Can Be the Right Tool</h2>
<p>Let me state a bold, audacious hypothesis: The goto statement can significantly facilitate the creation of new code and the readability/editability of existing code whilst maintaining a high level of performance.</p>
<h2>Problem: Deeply Nested Logic</h2>
<p>When writing new code, a programmer works from a mental model of a problem, and the mental model drives the code generation. In contrast, when reading or editing existing code, the programmer attempts to synthesize a mental model from existing code, and the code facilitates generation of the mental model. The differences between these two underlying processes are significant, and they can lead to code that was easily written, but proves very difficult to read.</p>
<p>Deeply nested conditionals, a code structure some refer to as arrow code (see <a href="http://c2.com/cgi/wiki?ArrowAntiPattern">Arrow Anti Pattern</a>, <a href="http://www.codinghorror.com/blog/2006/01/flattening-arrow-code.html">Flattening Arrow Code</a>), provide an example of code that suffers from poor readability. When crafting new code, I&#8217;ve whipped out five levels of nested conditionals without breaking a sweat. Such is the power of working from a comprehensive mental model. However, returning to deeply-nested code (even after a short break) has often lead to hours of exasperating re-learning and refactoring.</p>
<p>Fortunately, there are techniques that can be used to limit the depth of the conditionals, including:</p>
<ul>
<li><a href="http://martinfowler.com/refactoring/catalog/replaceNestedConditionalWithGuardClauses.html">Using guard clauses</a>.</li>
<li><a href="http://drdobbs.com/architecture-and-design/231500074">Grouping conditions and pushing them towards the top level</a>.</li>
<li><a href="http://www.codinghorror.com/blog/2006/01/flattening-arrow-code.html">Pulling out code blocks into functions</a>.</li>
</ul>
<p>These techniques can be very effective, as they all help flatten the display of the program flow and limit the levels of nesting. However, these techniques are not without their own potential issues, as they can hurt readability (proximity of relevant factors can be hampered, the flow of operations might not match the natural mental schema), complicate maintainability, and degrade performance (e.g., adding function calls to the stack.)</p>
<h2>Example: Deeply Nested Value Store Function</h2>
<p>Let&#8217;s look at an example of some code that&#8217;s deeply nested. We&#8217;re going to use <a href="http://php.net/">PHP</a> to craft our example because <a href="http://php.net/manual/en/control-structures.goto.php">PHP offers a form of the goto statement that significantly restricts its use</a>:</p>
<ul>
<li>Goto targets must point somewhere within the same file and context, so goto cannot jump out of the current function/method.</li>
<li>Goto targets cannot be used to jump into a control structure, so goto cannot jump into a loop or switch statement.</li>
</ul>
<div>Let&#8217;s work through a simple function that works as a value store. It allows you to store or set individual values, retrieve the entire set of stored values, and declare values immutable so subsequent updates throw an exception. I&#8217;ve omitted comments so the characteristics of the code flow and structures remain the focal point of the example.</div>
<pre>function val_nested($name = null, $value = null, $is_mutable = false)
{
	static $values = array();
	static $mutables = array();

	if ($name === null) {
		return $values;
	} else {
		if ($value === null) {
			if (isset($values[$name])) {
				return $values[$name];
			} else {
				return null;
			}
		} else {
			if (isset($values[$name])) {
				if (!$val_is_mutable = in_array($name, $mutables)) {
					throw new Exception('The value "' . $name . '" is immutable and has already been set to '.$values[$name].'.');
				} else {
					return $values[$name] = $value;
				}
			} else {
				if ($is_mutable) {
					$mutables[] = $name;
				} 

				$values[$name] = $value;
				return $value;
			}
		}
	}
}</pre>
<h2>Refactored Example: Nesting Reduced Using Standard Practices</h2>
<p>Below, I&#8217;ve provided a refactored version of the value store function that utilizes a combination of the refactoring approaches outlined earlier. Guard clauses have been utilized to bail out as early as possible in the function. The get and set operations have been pulled out into separate functions. And, conditions have been grouped to avoid nesting conditionals. The result is code that requires no more than one level of if-blocks.</p>
<p>My concerns with the refactored version include:</p>
<ul>
<li>The flow of the code neither matches the mental model I have when writing new code nor promotes the acquisition of a mental model when I&#8217;m reading existing code.</li>
<li>The proximity of relevant information seems to suffer.</li>
<li>Adding functions merely for organization (i.e., the functions are unlikely to be reused) degrades performance solely for the sake of organization. Some may say that this concern is tantamount to premature optimization. I disagree, as we&#8217;re talking about the techniques that will be used to organize every single function/method block in the code base, and doubling the function calls used in any code base (which in this example roughly doubles the execution time of the refactored function) is a meaningful performance concern.</li>
</ul>
<pre>function val_refactor_get($name, $values)
{
	if (isset($values[$name])) {
		return $values[$name];
	} else {
		return null;
	}
}

function val_refactor_set($name, $value, $is_mutable, &amp;$values, &amp;$mutables)
{
	$val_already_set = isset($values[$name]);

	if (!$val_already_set &amp;&amp; $is_mutable) {
		$mutables[] = $name;
		return $values[$name] = $value;
	}

	if (!$val_already_set &amp;&amp; !$is_mutable) {
		return $values[$name] = $value;
	}

	$stored_val_is_mutable = in_array($name, $mutables);

	if (!$stored_val_is_mutable) {
		throw new Exception('The value "' . $name . '" is immutable and has already been set to '.$values[$name].'.');
	}

	return $values[$name] = $value;
}

function val_refactor($name = null, $value = null, $is_mutable = false)
{
	static $values = array();
	static $mutables = array();

	if ($name === null) {
		return $values;
	}

	if ($value === null) {
		return val_refactor_get($name, $values);
	}

	return val_refactor_set($name, $value, $is_mutable, $values, $mutables);
}</pre>
<h2>GOTO Example: A New (Old) Hope</h2>
<p>The last code example utilizes PHP&#8217;s goto construct to eliminate the deep nesting. As earlier noted, PHP provides some restrictions on its version of the goto construct, and we&#8217;ll add one more for the sake of our usage: All goto branches must return a value. This self-imposed restriction ensures that no flow of execution will fall unintentionally into any other labeled block.</p>
<p>I see a few primary concerns with this version. First, this example is the longest of the three. Second, IDE/debugger support for this approach likely ranges from poor to non-existant. Third, and this is a biggie: THIS EXAMPLE USES GOTO AND SOME OF YOU WOULD NEVER, EVER LET THAT HAPPEN!!!</p>
<p>That said, I sincerely believe this version holds significant advantages over the previous versions thanks to the goto construct. While writing new code, I can follow the natural flow of the mental model I&#8217;ve developed without worrying about controlling the nesting of the logic through the other techniques. And, while reading and applying edits to existing code, the goto labels provide valuable meta information about the sections of code. If the need arises to add an additional check in the logic, the goto version facilitates finding the location to add the appropriate code, and the structure accommodates the changes with relative ease. Finally, because the goto version doesn&#8217;t require more function calls, its performance is on par with the version utilizing deeply-nested if-blocks.</p>
<pre>function val_goto($name = null, $value = null, $is_mutable = false)
{
	static $values = array();
	static $mutables = array();

	if ($name === null) {
		goto get_all_values;
	} else {
		goto access_value;
	}

	get_all_values:
		return $values;

	access_value:
		if ($value === null) {
			goto get_value;
		} else {
			goto set_value;
		}

	get_value:
		if (isset($values[$name])) {
			return $values[$name];
		} else {
			return null;
		}

	set_value:
		if (isset($values[$name])) {
			goto set_existing_value;
		} else {
			goto set_new_value;
		}	

	set_existing_value:
		if (!$val_is_mutable = in_array($name, $mutables)) {
			throw new Exception('The value "' . $name . '" is immutable and has already been set to '.$values[$name].'.');
		} else {
			return $values[$name] = $value;
		}

	set_new_value:
		if ($is_mutable) {
			$mutables[] = $name;
		}

		return $values[$name] = $value;
}</pre>
<h2>Conclusion: Goto Can Be Your Friend</h2>
<p>OK, you&#8217;ve heard my case for goto, at least the restricted version of goto found in PHP (augmented with our one additional restriction) when used to combat deeply nested logic. In fact, I believe the use of the goto construct in the final example does in fact facilitate the creation of new code and the readability/editability of existing code whilst maintaining a high level of performance.</p>
<p>What do you think?</p>
<p><strong>Update Feb. 17, 2012:</strong><br />
Here&#8217;s a great read from the Linux kernel mailing list that discusses why the goto statement is used in the code base: <a href="http://kerneltrap.org/node/553">http://kerneltrap.org/node/553</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adamjonrichardson.com/2012/02/06/long-live-the-goto-statement/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>XSS Prevention in Four Simple Steps</title>
		<link>http://adamjonrichardson.com/2012/02/01/improving-xss-cross-site-scripting-prevention-in-four-simple-steps/</link>
		<comments>http://adamjonrichardson.com/2012/02/01/improving-xss-cross-site-scripting-prevention-in-four-simple-steps/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 08:53:42 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://adamjonrichardson.com/?p=68</guid>
		<description><![CDATA[Preventing Cross Site Scripting (XSS) attacks is a daunting task for developers. In short, XSS attacks are an injection attack in which data that is structurally significant in the current context changes the intended semantics and/or functionality. While there are...]]></description>
				<content:encoded><![CDATA[<p>Preventing <a href="https://www.owasp.org/index.php/XSS">Cross Site Scripting (XSS)</a> attacks is a daunting task for developers. In short, XSS attacks are an injection attack in which data that is structurally significant in the current context changes the intended semantics and/or functionality. While there are great resources online that walk you through prevention techniques (<a href="https://www.owasp.org/index.php/Main_Page">one of the best security resources is The Open Web Application Security Project, or OWASP, website</a>), it&#8217;s easy to get confused when you try to implement all of the necessary safeguards.</p>
<p>Below, I&#8217;ve outlined four simple steps that significantly lower the risk of XSS attacks against your website. By being a bit more restrictive, we can simplify our approach to preventing XSS <span id="more-68"></span> in the most common use cases. <strong>These steps must all be implemented together, but there&#8217;s only four of them, so c&#8217;mon, you can do it <img src='http://adamjonrichardson.com/the-wp-7788/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<h2>Step 1: Escape Output Provided by Users</h2>
<p>If you want to include data within a page that&#8217;s been provided by users, escape the output. And, in this simplified list, we&#8217;re going to stick with one simple escape operation: HTML encode any <strong>&lt;</strong>, <strong>&gt;</strong>, <strong>&amp;</strong>, <strong>&#8216;</strong>, <strong>&#8220;</strong>. For example, PHP provides the <a href="http://php.net/manual/en/function.htmlspecialchars.php">htmlspecialchars() function</a> to accomplish this common task.</p>
<h2>Step 2: Always Use XHTML</h2>
<p>Read through <a href="https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet">OWASP&#8217;s XSS prevention strategies</a>, and it becomes apparent that protecting against injection requires much more effort if you use unquoted attributes in your HTML. In contrast, in quoted attributes, escaping data becomes the same process needed to escape data for content within tags, the escape operation we already outlined above. That&#8217;s because the only troublemaker in terms of sneaking in structurally significant content within the context of a quoted attribute is the closing quote.</p>
<p>Obviously, your markup doesn&#8217;t have to be XHTML in order to contain quoted attributes. However, shooting for and validating against XHTML makes it easy to test if all of the attributes are quoted.</p>
<h2>Step 3: Only Allow Alphanumeric Data Values in CSS and JavaScript</h2>
<p>We need to limit the data you allow from users that will be output within CSS and Javascript sections of the page to alphanumeric (e.g., a regex like [a-zA-Z0-9]+) types, and make sure they are used in a context in which they truly represent values. In Javascript this means user data should only be output within quoted strings assigned to variables (e.g., <em>var userId = &#8220;ALPHANUMERIC_USER_ID_HERE&#8221;;</em>.) In CSS this means that user data should only be output within the context for a property value (e.g., <em>p { color: #ALPHANUMERIC_USER_COLOR_HERE;}</em>.) This might seem Draconian, but, hey, this is supposed to be a simple XSS tutorial <img src='http://adamjonrichardson.com/the-wp-7788/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Now, to be clear, you should always validate user data to make sure it meets your expectations, even for data that&#8217;s output within tags or attributes, as in the earlier examples. However, it&#8217;s especially important for CSS and JavaScript regions, as the complexity of the possible data structures makes it exceedingly difficult to prevent XSS attacks.</p>
<p>Common data you might want users to be able supply to your JavaScript such as Facebook, Youtube, and Twitter ID&#8217;s can all be used whilst accommodating this restriction.   And, CSS color attributes and other styles can be integrated, too.</p>
<h2>Step 4: URL-Encode URL Query String Parameters</h2>
<p>If user data is output within a URL parameter of a link query string, make sure to URL-encode the data.  Again, using PHP as example, you can simply use the <a href="http://php.net/manual/en/function.urlencode.php">urlencode() function</a>. Now, let&#8217;s be clear on this and work through a couple examples, as I&#8217;ve seen much confusion concerning this particular point.</p>
<h3>Must URL-encode</h3>
<p>The following example outputs user data that must be URL-encoded because it is used as a value in the query string.</p>
<p>&lt;a href=&#8221;http://site.com?id=USER_DATA_HERE_MUST_BE_URL_ENCODED&#8221;&gt;</p>
<h3>Must Not URL-Encode</h3>
<p>The following example outputs the user-supplied data for the entire URL. In this case, the user data should be escaped with the standard escape function (HTML encode any <strong>&lt;</strong>, <strong>&gt;</strong>, <strong>&amp;</strong>, <strong>&#8216;</strong>, <strong>&#8220;</strong>), not URL-encoded. URL-encoding this example would lead to malformed links.</p>
<p>&lt;a href=&#8221;USER_DATA_HERE_MUST_USE_STANDARD_HTML_ESCAPING&#8221;&gt;</p>
<h2>Summary</h2>
<p>Let me be clear: These four steps don&#8217;t instantly secure a website against all XSS attacks, and I purposely skipped over some very important, related topics (<a href="https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#Bonus_Rule:_Use_HTTPOnly_cookie_flag">cookie settings</a>, <a href="https://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet">DOM Injection</a>, the risk of including user-provided data in data-schemed URI&#8217;s, other contexts such as SVG, etc) that the <a href="https://www.owasp.org/index.php/Main_Page">OWASP website</a> covers very well. Additionally, the limitations outlined above may be too restrictive for some websites, although the number of websites that truly has to offer more flexibility in terms of CSS and Javascript output is likely very small.</p>
<p>That said, these four steps provide a an approach to defending against XSS that is easily remembered and implemented, covers a broad range of typical website scenarios, and serves as a solid start for developers who are learning how to address basic security concerns.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamjonrichardson.com/2012/02/01/improving-xss-cross-site-scripting-prevention-in-four-simple-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Structurally compatible type checking in JavaScript with haven.js</title>
		<link>http://adamjonrichardson.com/2011/12/29/structurally-compatible-type-checking-in-javascript-with-haven-js/</link>
		<comments>http://adamjonrichardson.com/2011/12/29/structurally-compatible-type-checking-in-javascript-with-haven-js/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 08:47:41 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[haven.js]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Type Checking]]></category>

		<guid isPermaLink="false">http://adamjonrichardson.com/?p=50</guid>
		<description><![CDATA[JavaScript has come a long way since the early days of the web, a time when the language was utilized to add a quick pop-up to a page, make some gaudy graphic move across the screen, or, if you were...]]></description>
				<content:encoded><![CDATA[<p>JavaScript has come a long way since the early days of the web, a time when the language was utilized to add a quick pop-up to a page, make some gaudy graphic move across the screen, or, if you were really fancy, error check a few fields in a web form. Today, javascript dominates the world of web development (both in the browser and on the server through technologies such as <a href="http://nodejs.org/">node.js</a>), speeds through tasks with <a href="http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php">performance that makes other languages envious</a>, and proves to be a very capable language in terms of implementing a broad range of programming paradigms.</p>
<p>Many online tutorials demonstrate how to implement Object Oriented Programming (OOP) patterns in JavaScript, and, I must confess, the language proves very capable in this respect. However, it&#8217;s JavaScript&#8217;s ability to implement Functional Programming (FP) patterns that has benefited <span id="more-50"></span> my work the most.</p>
<h2>Sharing logic</h2>
<p>There are many qualities that serve to contrast traditional OOP with FP (e.g, first-class functions, (im)mutability, side effects vs. purity, declarative vs. imperative style, etc.), but I&#8217;d like to focus on how logic is shared/reused within applications. OOP paradigms tend to share logic by explicitly pushing it out to objects through inheritance, composition, and/or mixins. In contrast, FP tends to push the data to the logic. FP makes this possible because functions typically act <strong>on</strong> data values rather than from <strong>within </strong>them.</p>
<p>For a trivial example of how I typically share logic when programming in JavaScript , let&#8217;s consider a function called createFormalGreeting(person) that expects a value (object) that contains a lastName field (string) and an isMale field (boolean). As long as the value contains these fields, it will be able to successfully return a string representation of a formal greeting. An employee value, a student value, or even an alien value (the truth is out there) could all be successfully passed to the function as an argument as long as they possess the required structural compatibility.</p>
<h2>haven.js</h2>
<p>While JavaScript facilitates many aspects of FP, I&#8217;ve missed the ability to declare the structural expectations of function parameters and return types (or, the ability to infer type as Haskell does.) I frequently find myself checking for the existence of fields in functions and doing quick tests of a value&#8217;s type to avoid <a href="http://www.codeproject.com/KB/scripting/javascript-gotchas.aspx?display=Print#double-eq">coercion gotchas</a>. In light of these issues, I&#8217;ve developed <a href="https://github.com/AdamJonR/haven.js">haven.js, a simple type checking framework for Javascript that tests for structural compatibility</a>.</p>
<p>The general idea behind haven.js is to ensure that all of the values passed into and out of functions are structurally compatible with the function&#8217;s expectations. It works by replacing function calls with wrapper functions that test the parameter and return types explicitly declared as object fields on the functions themselves. If type compatibilities are identified, the details are logged to the console (although the console is used by default, you can tell haven to throw exceptions instead, as you may wish to do when integrating results into unit tests.) I tend to turn off the type checking (i.e., simple don&#8217;t call the function haven.typeCheck) in code that&#8217;s released in production to avoid the performance hit.</p>
<p>So far, haven.js has greatly facilitated my work, and I hope you&#8217;ll get some benefit, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamjonrichardson.com/2011/12/29/structurally-compatible-type-checking-in-javascript-with-haven-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nice job, Davin Granroth, you&#8217;re an example of financial prudence</title>
		<link>http://adamjonrichardson.com/2011/12/20/nice-job-davin-granroth-youre-an-example-of-financial-prudence/</link>
		<comments>http://adamjonrichardson.com/2011/12/20/nice-job-davin-granroth-youre-an-example-of-financial-prudence/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 05:18:53 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://adamjonrichardson.com/?p=47</guid>
		<description><![CDATA[Just want to say that Davin Granroth has exemplified what it means to be financially wise over the past 3 years. He&#8217;s made great strides through sacrifice and restraint, whilst being generous to many. Essentially, God has allowed him to go...]]></description>
				<content:encoded><![CDATA[<p>Just want to say that <a href="http://davingranroth.com">Davin Granroth</a> has exemplified what it means to be financially wise over the past 3 years. He&#8217;s made great strides through sacrifice and restraint, whilst being generous to many. Essentially, God has allowed him to go All-Chuck-Norris on some debt, and it&#8217;s been a great pleasure to watch.</p>
<p>Now, if the Richardsons can just learn from his example instead of just watching and enjoying <em>his</em> progress, we&#8217;d really be on to something <img src='http://adamjonrichardson.com/the-wp-7788/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://adamjonrichardson.com/2011/12/20/nice-job-davin-granroth-youre-an-example-of-financial-prudence/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Great talk on software simplicity by Rich Hickey</title>
		<link>http://adamjonrichardson.com/2011/12/11/great-talk-on-software-simplicity-by-rich-hickey/</link>
		<comments>http://adamjonrichardson.com/2011/12/11/great-talk-on-software-simplicity-by-rich-hickey/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 10:52:37 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Development Methodologies]]></category>
		<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://adamjonrichardson.com/?p=32</guid>
		<description><![CDATA[This video is fantastic! I literally laughed aloud several times. If you&#8217;re a developer, I encourage you to watch it. Rich Hickey takes some digs at Agile, TDD, and OOP; provides ideas on pursuing simplicity in system development; and reveals...]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.infoq.com/presentations/Simple-Made-Easy">This video is fantastic</a>! I literally laughed aloud several times. If you&#8217;re a developer, I encourage you to watch it. Rich Hickey takes some digs at Agile, TDD, and OOP; provides ideas on pursuing simplicity in system development; and reveals some keen insights into his language design choices:</p>
<p><a href="http://www.infoq.com/presentations/Simple-Made-Easy">http://www.infoq.com/presentations/Simple-Made-Easy</a></p>
<p>Rich always provides great talks, but this one is one of the best, most entertaining I&#8217;ve seen. And, my word of the week is now &#8220;complect.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://adamjonrichardson.com/2011/12/11/great-talk-on-software-simplicity-by-rich-hickey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Frank talk on issues relevant to today&#8217;s developers from Dave Thomas at Splash 2011</title>
		<link>http://adamjonrichardson.com/2011/12/02/frank-talk-issues-relevant-to-todays-developers-from-dave-thomas-at-splash-2011/</link>
		<comments>http://adamjonrichardson.com/2011/12/02/frank-talk-issues-relevant-to-todays-developers-from-dave-thomas-at-splash-2011/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 06:39:41 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://adamjonrichardson.com/?p=21</guid>
		<description><![CDATA[I love how well spoken, down-to-earth, and frank Dave Thomas is in this video at Channel 9 taken at the SPLASH 2011 Conference. No, it&#8217;s not because of his answer to the question &#8220;What&#8217;s the state of Object Oriented Programming...]]></description>
				<content:encoded><![CDATA[<p>I love how well spoken, down-to-earth, and frank <a href="http://channel9.msdn.com/Blogs/Charles/SPLASH-2011-Dave-Thomas-On-Modern-Application-Development">Dave Thomas is in this video at Channel 9 taken at the SPLASH 2011 Conference</a>.</p>
<p>No, it&#8217;s not because of his answer to the question &#8220;What&#8217;s the state of Object Oriented Programming today in your mind?&#8221;, to which he responded that:</p>
<blockquote><p>I think the state is that it&#8217;s commercially immensely successful, but practically, I think it&#8217;s a disaster.</p></blockquote>
<p>Although I did agree with much of his analysis on that particular question, I sincerely believe that the whole video has wise words for anyone working as a developer now and in the near future.</p>
<p>And, of interest to me was the fact that he really appreciated the &#8220;good engineering decisions&#8221; represented in the design of <a href="http://www.dartlang.org/">Google&#8217;s Dart langauge</a>.</p>
<p>Watch it!</p>
]]></content:encoded>
			<wfw:commentRss>http://adamjonrichardson.com/2011/12/02/frank-talk-issues-relevant-to-todays-developers-from-dave-thomas-at-splash-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Obscurity by Security</title>
		<link>http://adamjonrichardson.com/2011/12/01/obscurity-by-security/</link>
		<comments>http://adamjonrichardson.com/2011/12/01/obscurity-by-security/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 08:33:57 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://adamjonrichardson.com/?p=14</guid>
		<description><![CDATA[What do I mean by &#8220;Obscurity by Security?&#8221; Keeping watch over the security requirements of simple applications, websites, large data stores containing sensitive information, or even the IT holdings of multi-million dollar corporations is unlike most other jobs. When a...]]></description>
				<content:encoded><![CDATA[<p>What do I mean by &#8220;Obscurity by Security?&#8221; Keeping watch over the security requirements of simple applications, websites, large data stores containing sensitive information, or even the IT holdings of multi-million dollar corporations is unlike most other jobs.</p>
<p>When a team cranks out a new iteration of the product with significant UX enhancements, noticeable performance increases, or demonstrated results in analytics, techies and non-techies alike can realize the enhancements and verbalize praise for the effort. After trying out the new sign-up form, a CEO may exclaim in the weekly executive meeting, &#8220;Great job! The new sign-up really flies, and my wife loves the look.&#8221; An office assistant may point out over lunch that the new website looks great on their brand new smart phone. And, customers will sometimes go out of their way to contact the company to let someone know that &#8220;Cheryl Smith provided fantastic customer support by quickly helping me recover all of the images I&#8217;d thought I&#8217;d lost.&#8221;</p>
<p>Sure, the feedback isn&#8217;t always positive (sometimes the CEO hates the new sign-up form, etc.), but the potential for fellow employees, industry peers, and/or general customers to notice and compliment nice work is there.</p>
<p>When do those in charge of security <span id="more-14"></span> get noticed? When the bored script kiddie gets through the hole in the legacy system that was supposed to be patched last week. When the new programmer&#8217;s little omission of an input check leads to a big buffer overflow, allowing the mob compromise the companies digital assets. When the company blogger opened an email that &#8220;seemed legit,&#8221; only to realize days later that someone has logged into their website and posted porn throughout.</p>
<p>In contrast to their coworkers, security professionals good days are when their work is barely a footnote in the executive meeting. Good days are when they&#8217;re contributions are tolerated by team leaders. Good days are when customers say absolutely nothing about security in their survey responses. When working on security, obscurity is the highest compliment.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamjonrichardson.com/2011/12/01/obscurity-by-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java, I&#8217;m growing weary and leery</title>
		<link>http://adamjonrichardson.com/2011/11/30/java-im-growing-weary-and-leery/</link>
		<comments>http://adamjonrichardson.com/2011/11/30/java-im-growing-weary-and-leery/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 06:52:14 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://adamjonrichardson.com/?p=6</guid>
		<description><![CDATA[Java, you&#8217;re a practical, performant option for development across the gambit of hardware solutions. You have wooed some of the most brilliant language designers, and they&#8217;ve responded to your advances with with new languages and runtimes that whisper sweet nothings...]]></description>
				<content:encoded><![CDATA[<p>Java, you&#8217;re a practical, performant option for development across the gambit of hardware solutions. You have wooed some of the most brilliant language designers, and they&#8217;ve responded to your advances with with new languages and runtimes that whisper sweet nothings into developers ears, all-the-while placating the cravings of managers for tried-and-true. But, you&#8217;ve changed, Java.</p>
<p>I used to, in my naive youth, pine for the security associated with your presence from afar, as I contrived my code to the whims of my clients&#8217; environments. Now, I fear you&#8217;ll rise from the deep and snatch away the pleasure of my current fancy (Clojure) through yet another exploitation of your capricious complexity.</p>
]]></content:encoded>
			<wfw:commentRss>http://adamjonrichardson.com/2011/11/30/java-im-growing-weary-and-leery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
