Cameron, it's well known that IIF is much slower. As far as I know, the 
only real advantage to using it is that it's useful in some cases because 
you can write less code, which can be easier to read. And it is useful if 
you actually need to return some evaluated expression.

Avi

At 11:02 AM 6/20/2001 +1200, Cameron wrote:
>Ok, after a bit of testing... can anyone tell me what the advantage of IIF 
>over if (<cfif> or if () {}), else (<cfelse> or else {}).
>
>I tested a simple block of code using IIF and <cfif><cfelse></cfif> & IIF 
>ran twice as slow...
>
>I can't see any major advantage by using it... yeah, it is kinda similar 
>to i = (true?1 : 2); in javascript but it's really slow case of the 
>implicit evaluate() on each part. Would be better if it was implicit & 
>made explicit, IF NEEDED.
>
>Can anyone give me a decent reason why IIF is better that <cfif>?
>
>Cameron Junge
>Web Developer


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to