Unable to load image

new stonetoss

https://i.rdrama.net/images/16800177441724613.webp

:marseyboomer:


Give me your money and I'll annoy people with it :space: https://i.rdrama.net/images/16965516366194396.webp

15
Jump in the discussion.

No email address required.

when do people even use recursion, seems like an overcomplication

Jump in the discussion.

No email address required.

I would assume that any recursive function (at least in C) can be re-written as more more memory-efficient iterative function, due to the stack-based nature of functions (at least in C).

I've never come across a recursive function that doesn't have that property, as tedious as it might be to create a good iterative replacement. Recursion is simply used because it is simpler in some contexts.

For example, I once wrote a program that processed some tree-like data, where the leaves are needed to solve the parent. Doing that recursively is simple. Doing that iteratively is a matter of finding all the leaves and working your way up by keeping track of a list of unsolved parents.

Jump in the discussion.

No email address required.

it makes you feel smarter which is all that matters

there's also stuff that's easier to write and digest in a recursive format imo


Give me your money and I'll annoy people with it :space: https://i.rdrama.net/images/16965516366194396.webp

Jump in the discussion.

No email address required.

:marseysuspicious: do you even functional program bro

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.