logoalt Hacker News

twictoday at 11:48 AM2 repliesview on HN

> It seems to be common knowledge that any recursive function can be transformed into an iterative function.

Huh. Where i work, the main problem is that everyone is hell-bent on transforming every iterative function into a recursive function. If i had a pound for every recursive function called "loop" in the codebase, i could retire.


Replies

skeeter2020today at 2:59 PM

My experience has gone the other way: lots of code with recursion, rewritten to be iterative. There really aren't that many use-cases in vanilla enterprise code that benefit from recursion when the entire cost is considered.

adafactortoday at 5:12 PM

Where on earth do you work? This is unusual...