Oddbean new post about | logout
 iterator enjoyer here

#golang doesn't have tail recursion so it's not a good idea for performance reasons and the usual places you use recursion are short, tight loops which is where the performance hit is gonna be greater

most functional languages and some OOP languages optimize with tail recursion but it's really overrated

if i see it's gonna call itself more than a few dozen times it's gonna be performance issue for chewing up stacks and triggering heap allocations

anyway, tail recursion, in the machine code, practically is the same as a for loop without a condition anyway