I see what you are saying.... hmmm, I still like code block two tho...
looks prettier :-)

-----Original Message-----
From: Andy Ewings [mailto:[EMAIL PROTECTED] 
Sent: 05 September 2003 11:37
To: CF-Talk
Subject: RE: Friday question.... any difference?


well at a guess I would have said that code block 1 was better because
you are doing 1 test and 1 set.  In code block 2 you are potentially
doing an unnecessary set making it slightly less efficient but if I'm
gonna pull you up on this I guess I oughta get out more ;)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 05 September 2003 11:39
To: CF-Talk
Subject: OT: Friday question.... any difference?


I was mulling this over last night.... 

Should there be any preference between the following two examples of
code?


<!---  Code Block 1 --->
<cfif myQuery.RecordCount>
        <cfset theName = myQuery.FIRST_NAME & " " & myQuery.LAST_NAME>
<cfelse>
        <cfset theName = "Undefined">
</cfif>


<!--- Code Block 2 --->
<cfset theName = "Undefined">
<cfif myQuery.RecordCount>
        <cfset theName = myQuery.FIRST_NAME & " " & myQuery.LAST_NAME>
</cfif>


I prefer code block 2 as it is one less line, but are there any
technical merits between the two

Does it matter? Should I get out more?  It can be grim up north you know
:-)

DC








~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to