4 ms·
Off-by-one errors must certainly more common in loops than in writing the base case of a recursive function--because the recursive description is more clear. Th
by karmakaze 12y ago
Off-by-one errors must certainly more common in loops than in writing the base case of a recursive function--because the recursive description is more clear. This is just about knowing the environment your code runs in. If the compiler doesn't optimize tail-calls and you'll have limited stack, then yes, it's the wrong choice.