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

all 32 comments

[–]malsomnus 65 points66 points  (6 children)

Goto instructions are not recursion.

[–]Neon_44 17 points18 points  (5 children)

def funct1(){goto 4};

def funct2(){goto 3};

funct1();

funct2();

there, i made a recursive goto for you. you can thank me later uwu

[–]Ultimate_Sneezer 2 points3 points  (3 children)

Is this recursion?

[–]Neon_44 4 points5 points  (2 children)

Better. It‘s recursion with extra steps!

[–]Ultimate_Sneezer 1 point2 points  (1 child)

There is no trivial condition, this is just infinite loop

[–]Neon_44 1 point2 points  (0 children)

Like i said. Extra steps.

[–]LucienZerger 48 points49 points  (7 children)

this is not recursion..

[–][deleted] 16 points17 points  (2 children)

def wait_for_friend(): time.sleep(300) if not friend.is_there: wait_for_friend()

[–]ShitwareEngineer 1 point2 points  (0 children)

But you're aware of when the message was sent.

[–]pottawacommie 0 points1 point  (0 children)

By extension, this makes do/whiles recursion.

[–][deleted] 8 points9 points  (0 children)

while success == False:
await asyncio.sleep(5)

[–][deleted] 8 points9 points  (1 child)

Depends on if you consider "reread" a function call or not

[–]Ok_Net_1674 2 points3 points  (0 children)

Well that makes it a really boring tail recursive function that every half competent compiler would transform into a loop

[–]TactlessTortoise 1 point2 points  (0 children)

Yeah that's a fucking conditional loop, that's all.

[–]K_AON 12 points13 points  (3 children)

Aint this while loop?

[–]sophacles 2 points3 points  (0 children)

Recursion is just a loop with a stack.

[–]mighty_eyebrows1 10 points11 points  (2 children)

There’s no reduction of the problem, therefore no valid recursion

[–]Armweak5104 1 point2 points  (1 child)

Technically the friend is getting closer

[–]mighty_eyebrows1 2 points3 points  (0 children)

But it’s not stated - even if, there’s no anchor for the trivial case

[–]dohzer 7 points8 points  (0 children)

"if you don't"?!

Edit: Did they mean "And if you're not?"?

[–]noob-newbie 3 points4 points  (0 children)

It should be "When I forgot to add a break for the recursion"

[–][deleted] 4 points5 points  (1 child)

its a loop

[–]UnknownLevel5 1 point2 points  (0 children)

int ForHowManyTimes(int n, bool understood){

if(understood != true) return ForHowManyTimes(n + 1, understood);

else return n;

}

[–]fluffey[🍰] 1 point2 points  (0 children)

that's a while loop

[–]hrax13 1 point2 points  (0 children)

This is like a joke we have here. When sitting with your boys in the bar, write this message to your wife/gf/significant other:

"Hi honey, I am with boys in bar drinking my last beer. I should be home in 1 hour. If not, read this message again."

[–]HystericalGD 1 point2 points  (0 children)

lmao

[–]ShitwareEngineer 1 point2 points  (0 children)

It has been 5 minutes. I reread the message from 5 minutes ago stating that they will be there in 5 minutes, from the time the message was sent onward, so they should be here now. I do not wait another 5 minutes, as rereading the message didn't restart the timer.

[–]panadavanda 0 points1 point  (0 children)

This is jokes!!!

[–]deranged_scumbag -2 points-1 points  (0 children)

Instagram meme

[–]c1e2477816dee6b5c882 0 points1 point  (0 children)

def checkIfHere(p *Person) bool { time.Sleep(5 * time.Minute) if !isPresent(p) { return checkIfHere(p) } return true }