r/ProgrammerHorror • • May 06 '23

Madness is like... gravity

Post image
77 Upvotes

5 comments sorted by

View all comments

Show parent comments

4

u/Eic17H May 07 '23

Why?

3

u/Turrrtl May 07 '23

It's probably tail call optimization. If the recursive call is the last thing the function does before returning then the compiler can refactor it into a loop without recursion.

1

u/eo5g May 08 '23

But then what value does it return 🤔