jackpot@lemmy.ml to Programming@programming.dev · 9 months agowhen is it best to use a recursive function vs a for loopmessage-squaremessage-square31fedilinkarrow-up131arrow-down12
arrow-up129arrow-down1message-squarewhen is it best to use a recursive function vs a for loopjackpot@lemmy.ml to Programming@programming.dev · 9 months agomessage-square31fedilink
minus-squarebizdelnick@lemmy.mllinkfedilinkarrow-up8arrow-down2·9 months agoIMHO almost never. Except for tree traversal, maybe.
minus-squarelivingcoder@programming.devlinkfedilinkarrow-up2·9 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.