General information
Category:
Coding, syntax & commands
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only