@jackpot@lemmy.ml to Programming@programming.dev • 7 months agowhen is it best to use a recursive function vs a for loopmessage-square50fedilinkarrow-up132
arrow-up132message-squarewhen is it best to use a recursive function vs a for loop@jackpot@lemmy.ml to Programming@programming.dev • 7 months agomessage-square50fedilink
minus-square@bizdelnick@lemmy.mllinkfedilink9•7 months agoIMHO almost never. Except for tree traversal, maybe.
minus-square@livingcoder@programming.devlinkfedilink2•7 months agoI would agree. Only if the performance is extremely similar but the readability (for some reason) is significantly better for the recursive solution would I choose that.
IMHO almost never. Except for tree traversal, maybe.
I would agree. Only if the performance is extremely similar but the readability (for some reason) is significantly better for the recursive solution would I choose that.