One of my favorite ways to think about recursion is that it's a shitty technique that can and will blow up your stack.
When I try to solve a problem with recursion, then I have two problems.
It's also a great way to filter out morons in interviews. If they ask for a recursive solution, and I tell them that it's a shitty solution, and if they don't immediately agree, then I know I'll be working with morons.
When I try to solve a problem with recursion, then I have two problems.
It's also a great way to filter out morons in interviews. If they ask for a recursive solution, and I tell them that it's a shitty solution, and if they don't immediately agree, then I know I'll be working with morons.