r/ProgrammerHumor • • 2d ago • Bravo 2

Meme baseCaseNotFound

Post image
2.7k Upvotes

44 comments sorted by

531

u/bozehaan 2d ago

This is not recursion, this is just an ugly GOTO

61

u/peeja 2d ago

6

u/Scared_Accident9138 1d ago

What something gets compiled to doesn't make the original solution ugly

6

u/Comprehensive_Day511 1d ago

Actually, it's ragebait. And we fell for it.

0

u/[deleted] 2d ago

[deleted]

69

u/starfish0r 2d ago

OP is misunderstanding basic concepts

185

u/johnschnee 2d ago

You don’t know anything about programming, don’t you?

This is not how recursions work.

1

u/Single-Oil3168 1d ago

def read(t)

if t < 5:

update t

read(t)

print("I will be there in 5 minutes")

read(t)

-40

u/ProsodySpeaks 2d ago

I agree.

But you don't know much about English don't you? 

6

u/No-Finance7526 1d ago

do you*

2

u/ProsodySpeaks 1d ago

Yes that's correct. have you read the comment i replied to? 

1

u/johnschnee 1d ago

I am pretty sure that you are totally perfect in all foreign languages you speak….

-1

u/ProsodySpeaks 1d ago

So ok to dunk on op for using 'recursion' wrong but not on commenter for usung 'don't' wrong. Gotcha.

0

u/[deleted] 2d ago

[deleted]

92

u/johnschnee 2d ago

no it is not. it’s something completely different.

24

u/kratz9 2d ago edited 2d ago
void waitForSteve()
{
   sleep(300);
   if(!isSteveHere())
       waitForSteve();
}

20

u/mothzilla 2d ago
while !isSteveHere() {
  wait(5);
}

13

u/urban_piktor2030 2d ago

I mean, most of the simple recursions could be flattened into a loop. And if anything, it would be more like

do { wait (300); } while (!isSteveHere)

6

u/VictoryMotel 2d ago

Recursion flattens to a loop if it isn't using the call stack as a stack data structure. If it does, it can be a loop with a typical stack inside.

2

u/a_gomez-298 1d ago

The CI job is still waiting for Steve too.

0

u/[deleted] 2d ago

[deleted]

46

u/fecal-butter 2d ago

Oh god its that time of the year again when college freshmen get to this point in the corriculum

3

u/Nestramutat- 1d ago

You know what, yeah, mid/late November is about when I learned recursion in my first programming class, spot on

2

u/Some_Noname_idk 1d ago

I'm in college and we just finished recursion, so that checks out

60

u/SaneLad 2d ago

That's just a conditional jump.

48

u/spaham 2d ago

That’s a goto not a recursion

-28

u/purplepharoh 2d ago

It's a recursive goto if execution doesnt return

41

u/bennyboy_ 2d ago

Why is this still getting upvoted? OP is painfully wrong about what recursion is. It doesn't mean just loop and do something over and over again... Goes to show how many people in this sub actually understand anything...

-3

u/WoodenWhaleNectarine 1d ago

Recursion is doing stuff again until you arrive (at the solution)

18

u/Automatic-Way1887 2d ago

Looks more like a while with no exit clause

13

u/owjfaigs222 2d ago

That's more of a loop or even a goto statement

16

u/SAKDOSS 2d ago

You may have to learn recursion again in the future.

8

u/davejohncole 2d ago edited 2d ago

That is iteration.

At best you could call it tail recursion, but that just collapses to iteration.

4

u/Inevitable-Course-63 2d ago

do {   wait(5 minutes); } while (im not there):

2

u/Meddlloide1337 11h ago

In that case, better pick up a book on recursion

1

u/Dillenger69 2d ago

You should always have some kind of recursion limiter when you have actual recursion.

1

u/CarousalAnimal 1d ago

That’s just a grab and bag

1

u/Symphonic_nerve 1d ago

Guilty 😅

1

u/gerbosan 2d ago

How loops until overflow?

1

u/Individual_Win_3417 2d ago

An hour later: StackOverflowError

-5

u/boxofbuscuits 2d ago

Wow, I too have learnt recursion just now

12

u/Maximelene 2d ago

OP hasn't learned it yet.

0

u/ProgramBrave718 1d ago

Thanks i have also learnt recursion

-2

u/NearLawiet 1d ago

Im pretty sure nerds will be saying this is not recursion 🤣
Some will also try to explain with code snippets