4 ms·
I tell them that recursive code is rarely better than iterative code As a general statement, this is wrong. Recursive code is almost always better than imperat
by sid0 16y ago
I tell them that recursive code is rarely better than iterative code
As a general statement, this is wrong. Recursive code is almost always better than imperative code in languages designed to encourage recursion -- I'm thinking of functional languages here, of course. Please qualify your statements to your students, lest they get the idea that it is a problem with recursion as a principle rather than a problem with the language they're working in.