Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do Factorials in VFP with Recursion
Message
From
23/02/2000 20:55:58
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00335196
Message ID:
00336473
Views:
17
>Well I had a misplaced ) so my code was really only testing the boundary condition of doing 0! so it's a jaded benchmark for sure. *L*

I thought so... :) I've never seen a recursive solution faster than the non-recursive one.

>Several threads here have discussed that easier to maintain code is by far better than complex code that runs faster. I agree with that theory. I'd rank the code complexity of these Factorial functions, from least to most complex: recursive, nonrecursive, lookup.

I agree that readability/maintainability is better than performance (well, many times, not always). I disagree that the
recursive factorial can be easier to understand than a simple FOR... ENDFOR.

Vlad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform