Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nested IIF()'s Versus ICASE()
Message
 
To
03/03/2008 13:50:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01298206
Message ID:
01298216
Views:
25
>>>>What's the differences between nested IIF()'s and ICASE(). From what I can see, there's not
>>>>alot of difference syntactically. Are there any performance differences?
>>>>
>>>>
>>>>? ICASE(1 # 1, "One",;
>>>>	    2 # 2, "Two",;
>>>>	    3 = 3, "Three")
>>>>
>>>>? IIF(1 # 1, "One", IIF(2 # 2, "Two", IIF(3 = 3, "Three", "" )))
>>>>
>>>>
>>>>Of course, the ICASE seems more readable than the IIF()'s.
>>>
>>>Icase is faster and much more radable.
>>
>>At first I thought so too, but they're both boolean evaluations, so it seems that they would be about the
>>same.
>
>I am pretty sure that Icase is faster, but whether the difference is significant or not, I don't know. But the improved readability can be translated into improved maintainability, and that's enough for me. I have been able to tidy up some rally messy code.

I agree. I'm in the camp that like to maintain clean code.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform