jump to navigation

NOTE: The spam filter is being unusually aggressive. If you comment does not immediately appear, it has simply been placed in moderation and I will approve it as quickly as possible. Thank you for your patience.

"Murphy was an optimist!"

Simplifying Code August 11, 2010 9:55 pm

Posted by Doug McCaughan in : ColdFusion, Programming, Technology
, 2comments

Often I run across code like this:


<cfif ArrayIsEmpty(Cart.Products)>
     <cfset HasCart = False>
<cfelse>
     <cfset HasCart = True>
</cfif>

Frankly, that makes me twitch a little. This has the same result:


<cfset HasCart = NOT ArrayIsEmpty(Cart.Products)>

2comments

Deep Thought August 11, 2010 12:08 pm

Posted by Doug McCaughan in : Deep Thoughts, Philosophy
, add a comment

If my head explodes, who will clean up the mess?

add a comment