AdobeStock_455007340

Testing for True and False

What is the difference between and ? From a functional perspective nothing at all – IsDefined() returns YES or NO (or TRUE or FALSE) and if you don’t specify what it is your are comparing against then ColdFusion treats it as if you are checking for TRUE. But from a performance perspective there is indeed a difference – not specifying what you are comparing against executes quicker, as much as 10% quicker. The same is true for any comparison operations – if you can omit the comparison value, do so. (Applies to: ColdFusion All)

Leave a Reply