Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
After January 1st
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00308678
Message ID:
00312385
Views:
50
>George,
>
>Here's what the test returned on average fopr 100,000 interations;
>
>Do CASE: 0.6310
>One Liner: 0.3900
>IFs: 0.5110
>
>One interesting side note is that the times were exactly the same for every run.

I didn't get the same times with 100,000 iterations, but I wish I had your machine. You must be running something a lot faster than a PII 350< g >. While I didn't test the one liner, my results showed the IF took only about 2/3rds of the time of the DO CASE

>I still say that the IF and the DO CASE are equally as readable and understandable but teh one liner is complex and confusing requiring carefull attention to suss out exactly what it is doing. That is enough of a reason for me to prefer either the do case or the if approach.

This was the reason I mentioned the speed difference last. The readability factor was the most important thing, followed by the amount of code. I've mentioned this several times here, but this is exactly the reason why I prefer a DO WHILE...ENDDO over a FOR...ENDFOR when the number of iterations aren't fixed.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform