> And as an example, that's one I would disagree (vehemently) 
> with, unless 
> 'x' is a boolean (true/false).
> 
> If 'x' is genuinely boolean, then '<cfif x>' is the more 
> intentional way 
> to write it (although 'x' is a *terrible* name for a boolean 
> variable! :)
> 
> If 'x' is an integer, then the comparison should be against 
> zero - again, 
> emphasizing the *intention* behind the code.

Interesting. I would do this for readability, not speed. To take a
common example I would see 

<cfif myQuery.RecordCount>

as more readable and immediately understandable than 

<cfif myQuery.RecordCount gt 0>

I guess I am treating this integer as if it's a boolean meaning "Query
record set has rows". I guess also I think of any non-zero value as
boolean as I come from a CF background. Those from a more strict
background might not. I guess fundamentally we find what we normally do
to be more readable than what other people normally do. ;-)
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to