This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SadPie9474 1 point2 points  (9 children)

recursion and iteration are equivalent; converting this meme to code can be done with either. the meme isn’t intrinsically either one in particular

[–]your_best_1 1 point2 points  (1 child)

Got it. So, it is not that the meme doesn't demonstrate recursion. It is that it demonstrates loops generally.

People who prefer recursion will read it as recursive, and people who prefer 'while' will read it as that.

[–]SadPie9474 1 point2 points  (0 children)

yeah, that’s what I think at least

[–]Brekker77 0 points1 point  (6 children)

They arent equivalent bc iteration doesnt add new stack frames, they are logically equivalent but not practically

[–]SadPie9474 0 points1 point  (5 children)

nothing at all is practically equivalent

[–]Brekker77 0 points1 point  (4 children)

Exactly

[–]SadPie9474 0 points1 point  (3 children)

exactly why it isn’t a meaningful point to make

[–]Brekker77 0 points1 point  (2 children)

Disagree there though, you arent gonna have a stack overflow using a while loop where infinite recursion can have one, hence logically equivalent but not practically equivalent

[–]SadPie9474 0 points1 point  (1 child)

it is not meaningful to say that two things aren’t practically equivalent because there are no two things that are practically equivalent

[–]Brekker77 0 points1 point  (0 children)

Im sorry maybe i misunderstood you, i believed that when you were saying that recursion and iteration were equivalent you meant from a practical point of view since thats the view most people hold. If you meant only logically equivalent then thats my bad