[thelist] CF: Tip - Usage of Boolean Values

Ed McCarroll Ed at ComSimplicity.com
Tue Jul 15 15:58:08 CDT 2003


>     [1]   <cfif variable.is_true>
 
>     [2]   <cfif variable.is_true EQ "Yes">
 
> (Guestimate: [1] may be quicker because it's a simple evaluation of a 
> single boolean value, whereas [2] requires the fetching of the operand, 
> then the comparison of the two before returning the boolean.]

And also the fact that '"Yes"' is in text form, while the internal
representation of a boolean is usually a byte containing all ones
or all zeroes.  Thus [2] requires the conversion of one of the
operands, somewhere along the line.  (Not that I know how Cold
Fusion does it, but the issue must be addressed somewhere.)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ed McCarroll                          MailTo:Ed at ComSimplicity.com
ComSimplicity                                      (310) 838-4330
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



More information about the thelist mailing list