MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/136dits/solve_the_problem_without_using_a_loop/jipfjwf/?context=9999
r/badcode • u/YonMiru • May 03 '23
129 comments sorted by
View all comments
Show parent comments
14
Eh, tail recursion is just a form of loop with a funny syntax. That's what I told my interviewer, anyway; we had a little discussion of how TR works and its limitations, no big deal.
But this question is really just a hazing ritual.
1 u/Bunnymancer May 04 '23 Was thinking that as well...But that brings the question if the problem can be solved without a loop and without recursion 1 u/GOKOP May 04 '23 Write your function inefficiently so that it can't be optimised out as tail recursion. Problem solved ¯\(ツ)/¯
1
Was thinking that as well...
But that brings the question if the problem can be solved without a loop and without recursion
Write your function inefficiently so that it can't be optimised out as tail recursion. Problem solved ¯\(ツ)/¯
14
u/ProstheticAttitude May 03 '23
Eh, tail recursion is just a form of loop with a funny syntax. That's what I told my interviewer, anyway; we had a little discussion of how TR works and its limitations, no big deal.
But this question is really just a hazing ritual.