<?xml version="1.0" encoding="utf-8"?>

			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>The No-Dans Club - Clean Code</title>
			<link>http://www.nodans.com/index.cfm</link>
			<description>ColdFusion, Flex, Ajax and other items of interest</description>
			<language>en-us</language>
			<pubDate>Thu, 02 Sep 2010 12:48:25 -0700</pubDate>
			<lastBuildDate>Mon, 11 Jan 2010 07:48:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>sipacate@gmail.com</managingEditor>
			<webMaster>sipacate@gmail.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>sipacate@gmail.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			
			<itunes:explicit>no</itunes:explicit>
			
			<item>
				<title>So You Want Cleaner Code? Nesting Conditionals and Booleans</title>
				<link>http://www.nodans.com/index.cfm/2010/1/11/So-You-Want-Cleaner-Code-Nesting-Conditionals-and-Booleans</link>
				<description>
				
				This post continues the infrequent series on &lt;a href=&quot;http://www.nodans.com/index.cfm/Clean-Code&quot;&gt;Clean Code examples&lt;/a&gt;. If you are enjoying this series, come to &lt;a href=&quot;http://cfunited.com/blog/index.cfm/2009/11/18/Announcing-first-round-of-CFUnited-sessions&quot;&gt;CFUnited 2010&lt;/a&gt; and &lt;a href=&quot;http://www.cfobjective.com/&quot;&gt;CF.Objective() 2010&lt;/a&gt; to catch my presentation, Making Bad Code Good- Part 2, a live version of this series.

The main idea here is to provide practical examples of working code that can be written in a cleaner fashion. You may agree or disagree with what I&apos;ve written, and I want to hear from you either way in the comments. 

If you have a code sample you&apos;d like to see refactored, send it to me through email (if you have my email already) or through the &lt;a href=&quot;http://www.nodans.com/contact.cfm&quot;&gt;Contact Me&lt;/a&gt; form on this blog.

&lt;h3&gt;Code Sample&lt;/h3&gt;
&lt;code&gt;
&lt;cffunction name=&quot;execute&quot; access=&quot;public&quot; output=&quot;false&quot; returntype=&quot;boolean&quot;&gt;
	&lt;cfargument name=&quot;attributes&quot; required=&quot;true&quot;/&gt;
	&lt;cfset var local = structNew() /&gt;
	&lt;cfset local.customerGateway = createObject(&quot;component&quot;,&quot;model.customerGateway&quot;).init() /&gt;
	&lt;cfif structKeyExists( client, &quot;customerID&quot; ) AND val( client.customerID ) GT 0&gt;
		&lt;cfif val( arguments.customerGW.getByID( val(client.customerID ) ).getChallengeQuestionID() ) GT 0&gt;
			&lt;cfset local.result = &quot;true&quot; /&gt;
		&lt;/cfif&gt;
	&lt;cfelseif structKeyExists( arguments.attributes, &quot;ChallengeAnswer&quot;) AND 
				structKeyExists( arguments.attributes, &quot;ChallengeQuestionID&quot;) &gt;
		&lt;cfif structKeyExists( arguments.attributes, &quot;ChallengeQuestionID&quot;) AND val( attributes.ChallengeQuestionID ) GT 0&gt;
			&lt;cfif structKeyExists( arguments.attributes, &quot;ChallengeAnswer&quot;) AND len( trim( attributes.ChallengeAnswer ) ) GT 0&gt;
				&lt;cfset local.cust =	arguments.customerGW.getById( client.customerID ) /&gt; /&gt;
				&lt;cfset local.cust.setChallengeQuestionID( attributes.ChallengeQuestionID ) /&gt;
				&lt;cfset local.cust.setChallengeAnswer( attributes.ChallengeAnswer ) /&gt;
				&lt;cfset arguments.customerGW.save( cust ) /&gt;
				&lt;cfset local.result = &quot;true&quot; /&gt;
			&lt;cfelse&gt;
				&lt;cfset local.result = &quot;false&quot; /&gt;
				&lt;cfset attributes.userMessage= &quot;Please select a security question and provide an answer.&quot; /&gt;
			&lt;/cfif&gt;
		&lt;/cfif&gt;
	&lt;cfelse&gt;	
		&lt;cfset local.result = &quot;false&quot; /&gt;
	&lt;/cfif&gt;		
	&lt;cfreturn local.result /&gt;
&lt;/cffunction&gt;
&lt;/code&gt;

Read through the entire example and ask yourself the following questions:

&lt;ul&gt;
	&lt;li&gt;What is the purpose of this code block? What are you using for your inferences?&lt;/li&gt;
	&lt;li&gt;Is it clear what this code is doing? Why or why not?&lt;/li&gt;
	&lt;li&gt;Can you spot the subtle bug in the code?&lt;/li&gt;
&lt;/ul&gt;  [More]
				</description>
				
				<category>Clean Code</category>
				
				<pubDate>Mon, 11 Jan 2010 07:48:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2010/1/11/So-You-Want-Cleaner-Code-Nesting-Conditionals-and-Booleans</guid>
				
				
			</item>
			
			<item>
				<title>So You Want Cleaner Code? Return Statement Execution</title>
				<link>http://www.nodans.com/index.cfm/2009/12/30/So-You-Want-Cleaner-Code-Return-Statement-Execution</link>
				<description>
				
				I&apos;m going to start an infrequent series on &lt;a href=&quot;http://www.nodans.com/index.cfm/Clean-Code&quot;&gt;Clean Code examples&lt;/a&gt;. If you are enjoying this series, come to &lt;a href=&quot;http://cfunited.com/blog/index.cfm/2009/11/18/Announcing-first-round-of-CFUnited-sessions&quot;&gt;CFUnited 2010&lt;/a&gt; and &lt;a href=&quot;http://www.cfobjective.com/&quot;&gt;CF.Objective() 2010&lt;/a&gt; to catch my presentation, Making Bad Code Good- Part 2, a live version of this series.

The main idea here is to provide practical examples of working code that can be written in a cleaner fashion. You may agree or disagree with what I&apos;ve written, and I want to hear from you either way in the comments.

If you have a code sample you&apos;d like to see refactored, send it to me through email (if you have my email already) or through the &lt;a href=&quot;http://www.nodans.com/contact.cfm&quot;&gt;Contact Me&lt;/a&gt; form on this blog.

&lt;h3&gt;Code Sample&lt;/h3&gt;

&lt;code&gt;
&lt;cfif FindKey.Recordcount gt 0&gt;
	&lt;cfreturn true /&gt;
&lt;cfelse&gt;
	&lt;cfreturn false /&gt;
&lt;/cfif&gt;
&lt;/code&gt;  [More]
				</description>
				
				<category>Clean Code</category>
				
				<pubDate>Wed, 30 Dec 2009 12:05:00 -0700</pubDate>
				<guid>http://www.nodans.com/index.cfm/2009/12/30/So-You-Want-Cleaner-Code-Return-Statement-Execution</guid>
				
				
			</item>
			</channel></rss>