3 ms·
"a language that supports it properly..." Meaning what exactly? A language that automatically optimized for tail recursion? Are there languages which don't s
by boucher 19y ago
"a language that supports it properly..."
Meaning what exactly? A language that automatically optimized for tail recursion? Are there languages which don't support recursion "properly?"
- omouse 19y agoA few years ago my friend wrote up a few recursive functions in C and they were slower than using a for loop. Since then I haven't used any sort of recursion in C or C++. Maybe my fears are unfounded but I try and avoid those two languages in any case. edit: I just realized what I actually mean. Some programming languages, or the culture/community around them, do not seem to encourage certain things that can be done with the language. In the case of C/C++, while/do/for loops are used before recursion. In the case of Scheme, you try a recursive solution first and then go for a do-loop if you really need to...or something like that.
- dangph 19y ago> they were slower than using a for loop. Since then I haven't used any sort of recursion in C or C++. That's premature optimization.