Compare these two different way to compute factorials:
1) Without recursion, this method [written in
Java]:
2) With recursion, this [written in ML]:
Of course these are two completely different programming languages, but you get the idea; the recursive version is a more natural way to think
.
Of course you can re-write the recursive version in Java, but I've always liked the look of functional languages. Never quite understood some of the mind boggling stuff (like - prolog :eek
.
Recursion: see recursion
(Could not resist that one
)
[ January 06, 2005: Message edited by: Peter Rooke ]
[ January 06, 2005: Message edited by: Peter Rooke ]