Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To iif or not to iif = .t.
Message
 
To
31/05/2001 13:15:07
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00513276
Message ID:
00513380
Views:
15
>Was it a readability issue, or what? I'm still thinking that
>
c=a#b
is more clear and more readable than
>
c=iif(a=b, .f., .t.)
or, worse,
>
if a=b
>   c=.f.
>else
>   c=.t.
>endif
>Is it just my pet peeve, or are there some recommendations about this?

I do things like this sometimes for readability purposes. To shorten the expression may be nice in the final version of code, but while you working on it such short expression makes you (me :) to evaluate it in mind all the time when you read it. Moreover, sometimes you have to break IIF to several sub-IIFs, otherwise you will not be able to keep track of conditions and find the bugs. For example, considering GridHighlighter features, you might imagine the complexity of the final IIF which is stored to Dynamic... properties. You (me :)just cannot work with the expression of that kind in one line.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform