Re:Tail Call Optimization: The Musical
by jacquesm on Sunday January 08, 2023 @09:31AM
(#34299379)
Even a simple problem such as the 'Towers of Hanoi' looks to me like a pretty messy solution when done with loops and with recursion it all just falls into place.
[ Parent
| on HN ]
Recursion is great due to the implicit stack. The cases where you don't have an implicit stack, ie where tail call optimization works, are usually easier and much clearer to just do in a loop.