|
|
|
|
|
by mafribe
3773 days ago
|
|
I agree, that simple loops that you describe are easier to analyse than full recursion. But simple loops are not as expressive as full loops (where you can modify the loop variable). As a simple example, try to phrase the Euclid's algorithm for computing the GCD using "for(int i = 0; i < n; i++) { ... }" where "i" is not modified in the loop body. |
|
I'm really just advocating a rule of least power. Don't go into full general recursion just because you can.