jackpot@lemmy.mlBanned to Programming@programming.dev · 2 years agowhen is it best to use a recursive function vs a for loopmessage-squaremessage-square31linkfedilinkarrow-up132
arrow-up130message-squarewhen is it best to use a recursive function vs a for loopjackpot@lemmy.mlBanned to Programming@programming.dev · 2 years agomessage-square31linkfedilink
minus-squarebizdelnick@lemmy.mllinkfedilinkarrow-up9arrow-down2·2 years agoIMHO almost never. Except for tree traversal, maybe.
minus-squarelivingcoder@programming.devlinkfedilinkarrow-up2·2 years 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.