MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1y69oaj/basecasenotfound/
r/ProgrammerHumor • u/ItsPuspendu • 1d ago • 1
43 comments sorted by
510
This is not recursion, this is just an ugly GOTO
59 u/peeja 1d ago Potato, potato. 6 u/Scared_Accident9138 1d ago What something gets compiled to doesn't make the original solution ugly 5 u/Comprehensive_Day511 1d ago Actually, it's ragebait. And we fell for it. 0 u/[deleted] 1d ago [deleted] — view deleted comment 69 u/starfish0r 1d ago OP is misunderstanding basic concepts 14 u/SkollFenrirson 1d ago Welcome to r/programmerhumor
59
Potato, potato.
6 u/Scared_Accident9138 1d ago What something gets compiled to doesn't make the original solution ugly
6
What something gets compiled to doesn't make the original solution ugly
5
Actually, it's ragebait. And we fell for it.
0
[deleted] — view deleted comment
69 u/starfish0r 1d ago OP is misunderstanding basic concepts 14 u/SkollFenrirson 1d ago Welcome to r/programmerhumor
69
OP is misunderstanding basic concepts
14 u/SkollFenrirson 1d ago Welcome to r/programmerhumor
14
Welcome to r/programmerhumor
174
You don’t know anything about programming, don’t you?
This is not how recursions work.
2 u/Single-Oil3168 17h ago def read(t)if t < 5:update tread(t)print("I will be there in 5 minutes")read(t) -39 u/ProsodySpeaks 1d ago I agree.But you don't know much about English don't you? 7 u/No-Finance7526 19h ago do you* 1 u/ProsodySpeaks 17h ago Yes that's correct. have you read the comment i replied to? 1 u/johnschnee 17h ago I am pretty sure that you are totally perfect in all foreign languages you speak…. -1 u/ProsodySpeaks 15h ago So ok to dunk on op for using 'recursion' wrong but not on commenter for usung 'don't' wrong. Gotcha. 0 u/[deleted] 1d ago [deleted] — view deleted comment 92 u/johnschnee 1d ago no it is not. it’s something completely different. 24 u/kratz9 1d ago edited 1d ago void waitForSteve() { sleep(300); if(!isSteveHere()) waitForSteve(); } 20 u/mothzilla 1d ago while !isSteveHere() { wait(5); } 13 u/urban_piktor2030 1d ago I mean, most of the simple recursions could be flattened into a loop. And if anything, it would be more likedo { wait (300); } while (!isSteveHere) 6 u/VictoryMotel 1d 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 9h ago The CI job is still waiting for Steve too. 0 u/[deleted] 1d ago [deleted] — view deleted comment 46 u/fecal-butter 1d 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
2
def read(t)
if t < 5:
update t
read(t)
print("I will be there in 5 minutes")
-39
I agree.
But you don't know much about English don't you?
7 u/No-Finance7526 19h ago do you* 1 u/ProsodySpeaks 17h ago Yes that's correct. have you read the comment i replied to? 1 u/johnschnee 17h ago I am pretty sure that you are totally perfect in all foreign languages you speak…. -1 u/ProsodySpeaks 15h ago So ok to dunk on op for using 'recursion' wrong but not on commenter for usung 'don't' wrong. Gotcha.
7
do you*
1 u/ProsodySpeaks 17h ago Yes that's correct. have you read the comment i replied to?
1
Yes that's correct. have you read the comment i replied to?
I am pretty sure that you are totally perfect in all foreign languages you speak….
-1 u/ProsodySpeaks 15h ago So ok to dunk on op for using 'recursion' wrong but not on commenter for usung 'don't' wrong. Gotcha.
-1
So ok to dunk on op for using 'recursion' wrong but not on commenter for usung 'don't' wrong. Gotcha.
92 u/johnschnee 1d ago no it is not. it’s something completely different. 24 u/kratz9 1d ago edited 1d ago void waitForSteve() { sleep(300); if(!isSteveHere()) waitForSteve(); } 20 u/mothzilla 1d ago while !isSteveHere() { wait(5); } 13 u/urban_piktor2030 1d ago I mean, most of the simple recursions could be flattened into a loop. And if anything, it would be more likedo { wait (300); } while (!isSteveHere) 6 u/VictoryMotel 1d 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 9h ago The CI job is still waiting for Steve too. 0 u/[deleted] 1d ago [deleted] — view deleted comment 46 u/fecal-butter 1d 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
92
no it is not. it’s something completely different.
24 u/kratz9 1d ago edited 1d ago void waitForSteve() { sleep(300); if(!isSteveHere()) waitForSteve(); } 20 u/mothzilla 1d ago while !isSteveHere() { wait(5); } 13 u/urban_piktor2030 1d ago I mean, most of the simple recursions could be flattened into a loop. And if anything, it would be more likedo { wait (300); } while (!isSteveHere) 6 u/VictoryMotel 1d 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 9h ago The CI job is still waiting for Steve too. 0 u/[deleted] 1d ago [deleted] — view deleted comment 46 u/fecal-butter 1d 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
24
void waitForSteve() { sleep(300); if(!isSteveHere()) waitForSteve(); }
20 u/mothzilla 1d ago while !isSteveHere() { wait(5); } 13 u/urban_piktor2030 1d ago I mean, most of the simple recursions could be flattened into a loop. And if anything, it would be more likedo { wait (300); } while (!isSteveHere) 6 u/VictoryMotel 1d 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 9h ago The CI job is still waiting for Steve too.
20
while !isSteveHere() { wait(5); }
13 u/urban_piktor2030 1d ago I mean, most of the simple recursions could be flattened into a loop. And if anything, it would be more likedo { wait (300); } while (!isSteveHere) 6 u/VictoryMotel 1d 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.
13
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 1d 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.
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.
The CI job is still waiting for Steve too.
46 u/fecal-butter 1d 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
46
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
3
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
I'm in college and we just finished recursion, so that checks out
58
That's just a conditional jump.
45
That’s a goto not a recursion
-25 u/purplepharoh 1d ago It's a recursive goto if execution doesnt return
-25
It's a recursive goto if execution doesnt return
33
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...
0 u/WoodenWhaleNectarine 9h ago Recursion is doing stuff again until you arrive (at the solution)
Recursion is doing stuff again until you arrive (at the solution)
18
Looks more like a while with no exit clause
That's more of a loop or even a goto statement
8
That is iteration.
At best you could call it tail recursion, but that just collapses to iteration.
15
You may have to learn recursion again in the future.
4
do { wait(5 minutes); } while (im not there):
The base case is them actually showing up, so yeah this one never returns.
You should always have some kind of recursion limiter when you have actual recursion.
That’s just a grab and bag
Guilty 😅
Thanks i have also learnt recursion
How loops until overflow?
An hour later: StackOverflowError
-4
Wow, I too have learnt recursion just now
12 u/Maximelene 1d ago OP hasn't learned it yet.
12
OP hasn't learned it yet.
Im pretty sure nerds will be saying this is not recursion 🤣Some will also try to explain with code snippets
510
u/bozehaan 1d ago
This is not recursion, this is just an ugly GOTO
174
u/johnschnee 1d ago
You don’t know anything about programming, don’t you?
This is not how recursions work.
58
u/SaneLad 1d ago
That's just a conditional jump.
45
u/spaham 1d ago
That’s a goto not a recursion
33
u/bennyboy_ 1d 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...
18
u/Automatic-Way1887 1d ago
Looks more like a while with no exit clause
13
u/owjfaigs222 1d ago
That's more of a loop or even a goto statement
8
u/davejohncole 1d ago edited 1d ago
That is iteration.
At best you could call it tail recursion, but that just collapses to iteration.
15
u/SAKDOSS 1d ago
You may have to learn recursion again in the future.
4
u/Inevitable-Course-63 1d ago
do { wait(5 minutes); } while (im not there):
2
u/idimetrix 1d ago
The base case is them actually showing up, so yeah this one never returns.
1
u/Dillenger69 1d 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/ProgramBrave718 18h ago
Thanks i have also learnt recursion
1
u/gerbosan 1d ago
How loops until overflow?
1
u/Individual_Win_3417 1d ago
An hour later: StackOverflowError
-4
u/boxofbuscuits 1d ago
Wow, I too have learnt recursion just now
-1
u/NearLawiet 1d ago
Im pretty sure nerds will be saying this is not recursion 🤣
Some will also try to explain with code snippets