Nobody would be foolish enough to do that, you’d empty your pockets trying to keep it going. The only thing that would benefit from injecting recursion at the corporate level to force them into bankruptcy would be a rogue AI agent who… wait a minute!
Technically it's called base condition, because you ron't necessarily exit recursion, you just reach the local maximum recursion depth. Exit condition is for while loops.
92
u/Hip-Death-Goddess Sep 20 '26
"Stack overflow, take the wheel" is my bumper sticker
86
u/firemark_pl Sep 20 '26 •
Your exit condition is RAM now
35
u/void1984 Sep 20 '26
The stack will take care of the exit.
23
u/realmauer01 Sep 20 '26
Never use recursion. Heres how it works and how you do it. Just never use recursion.
11
u/yumii- Sep 20 '26
My professor in college years ago had us take a test on a shared linux server and executing code on it.
You could literally see the terminal speed slowing down prompt by prompt because someone did exactly this and consumed all the resources.
Professor was brand new, panicked, and cancelled the class and exam..
I also think more than one person made this mistake after talking to classmates 😂
4
u/Johnpecan Sep 20 '26
while (gru) doIt();
4
u/Lyshaka Sep 20 '26 •
Ah yes the infamous recursion
1
u/Important_Grab3544 Sep 20 '26
I am an AI programmer, what does this mean?
1
u/da_Aresinger Sep 20 '26
Ctrl-C
3
u/Silly_Guidance_8871 Sep 20 '26
Sure there is: The stack limit.
2
u/dervu Sep 20 '26
Don't need AI for paper clip maximier.
2
u/iggy14750 Sep 20 '26
Bro, I love fractals!
2
u/Shevvv Sep 20 '26
Technically it's called base condition, because you ron't necessarily exit recursion, you just reach the local maximum recursion depth. Exit condition is for while loops.
1
u/FunkyFungiTraveler Sep 20 '26
Hahaha
1
u/AaronTheElite007 Sep 20 '26
That’s a great way to chew up resources. Must be disgruntled
1
u/Adept-Painting-543 Sep 21 '26
Segmentation Fault (Core Dumped)
1
u/UUDDLRLRBadAlchemy Sep 22 '26
It's actually a joke about retirement
1
u/JackNotOLantern Sep 22 '26
There is always an exit condition. It's called stack overflow.
1
u/[deleted] Sep 20 '26
[removed] — view removed comment