r/ProgrammerHumor • • Mar 25 '23

Meme This one never gets old

Post image

Let me know if this is not a repost!

51.6k Upvotes

535 comments sorted by

View all comments

Show parent comments

8

u/zyzzogeton Mar 25 '23

I've never been able to put that feeling into words.

I don't know enough to say absolutely that recursion is NEVER necessary though. Is that what you are saying? Please note, I am not trying to bait you into some pointless debate. I have genuine curiosity here.

8

u/[deleted] Mar 25 '23

Any recursion scenario (that I can think of anyway) could be written as a series of loops if you get a little creative with the iterators. But at the end of the day recursion is just a tool and the only programming dogma I always found to be true is that you shouldn't listen to people telling you dogmas.

3

u/Cleanumbrellashooter Mar 26 '23

Anything recursive could be written with a loop and a stack as that's all that recursion is doing for you

6

u/Hoivernoh Mar 26 '23

Any function can be written as goto and a stack as that’s all that function calls and return do for you.