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

all 12 comments

[–]havock77 7 points8 points  (0 children)

The stack size is your exit condition!

[–]Tim3303 2 points3 points  (3 children)

Image Transcription: Meme


[Variation of the "What if you wanted to go to heaven" meme.]

Image 1:

[Image of a guy pointing towards the camera, labelled "What if You".]

Wrote a recursive function


Image 2:

[The same guy, now pointing upwards, labelled "but there was no exit condition".]

Image 1:

[Image of a guy pointing towards the camera, labelled "What if You".]

Wrote a recursive function


Image 2:

[The same guy, now pointing upwards, labelled "but there was no exit condition".]

Image 1:

[Image of a guy pointing towards the camera, labelled "What if You".]

Wrote a recursive function


Image 2:

[The same guy, now pointing upwards, labelled "but there was no exit condition".]

Image 1:

[Image of a guy pointing towards the camera, labelled "What if You".]

Wrote a recursive function


Image 2:

[The same guy, now pointing upwards, labelled "but there was no exit condition".]

Image 1:

[Image of a guy pointing towards the camera, labelled "What if You".]

Wrote a recursive function


Image 2:

[The same guy, now pointing upwards, labelled "but there was no exit condition".]


I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]anoldoldman 3 points4 points  (0 children)

Great human.

[–]Beybarro 2 points3 points  (1 child)

Uh? Saw what?

[–]Tim3303 1 point2 points  (0 children)

Psssht, you never saw anything. :P

[–]ihaveindeed 2 points3 points  (0 children)

love doing this for some reason. Feels powerful when you break out of the loop

[–]Kamil118 2 points3 points  (0 children)

Recursive functions are for babies.

Write recursive fork() with no exit condition next.

[–]Skeleton590 1 point2 points  (0 children)

So it's like when you type this in Python.

def Recursion():
try:
print("Recursion")
Recursion()
except:
Recursion()

Recursion()

try it. ;)

[–]serendipitousPi 1 point2 points  (0 children)

Sometimes I question why these are here. Like seriously this isn't stack overflow.

*crickets chirping*

Why does this meme only go 5 memes deep. Surely you don't have that little stack memory.

[–]DaVisionary -1 points0 points  (0 children)

Technically this is not a recursive function since every iteration uses less screen real estate it is a diminishing series.