Endless loop != recursion…
 A man walks into a bar and says "I'll have a joke a bout recursion please". The bartender says "Sure: A man walks into a bar and says "I'll have a joke a bout recursion please". The bartender says "Sure: A man walks into a bar and says "I'll have a joke a bout recursion please". The bartender says "Sure: A man walks into a bar and says "I'll have a joke a bout recursion please". The bartender says "Sure: ...
Technically a recursive function without a guard clause
== while (true)
even if recursive function without a guard clause
!== while (true)
.
depends on the language, ina. lot of languages a recursive function will crap out when the call stack maxes out while a while true will just keep going till killed.
what language doesn't crap out when the memory runs out?
none, but some of them have infinite loop protection.
That's why I said it's not exactly equal.
If the language supports tail recursion optimisation, it won't crap out, since the next iteration is made only after the previous iteration has concluded.
Embedded devs: where's the joke?
You know what I saw browsing some code for a dev board was this:
``` for(;;) { Â Â // Stuff }
```
And I don't know how to feel about it.
I've seen for(;;); before, accompanied by an interrupt
Was it cube ide for stm32?
Not a big fan, I call it the depressed endless loop ;-;
Accurate lol
break
is not an operator. It doesn't operate on anything.
It'll usually be documented as a statement.Â
If you're going to repost, it's time to clean up the meme. Refactor it a bit. Leave it nicer than you found it. Run the tests.Â
technically, break
can be considered a nullary operator, as it operates on the current loop, by ending it, without accepting any arguments.
I wouldn't consider it a nullary operator since it doesn't return a value either. You can argue that "it modifies PC so it's an operator on that register" - but that's a stretch in my view.Â
I didn't know we were allowed to fix stuff; I thought it was just technical debt that Dave was going to fix one of these days.
You’re confusing a recursive function without an exit clause, with an infinite loop
Who needs a break? Use redefine true to == false, duh.
Op did not write a line of code of his entire life, change my mind
Nah, just put a "go to" instruction.
Or use it with purpose to trap a microcontroller program after putting your contraption in a safety mode.Â
I would have added a few More iterations but yeah much better
wait there is a end to the meme so he did write a break statement
Maybe he used return?
I feel like the meme would be super long if it was a while loop instead of recursing on itself and just be Padme saying her line over and over.
Standard practice for microcontrollers.
You can throw an exception or kill the thread/process instead
int main(int, char**) {
while(true) {
laughInMainLoop();
repostBullshit();
refreshDay();
};
}
Return
This meme gets reposted so often, it feels recursive
Ikr I just saw it here
(Me clicking the link, scrolling down, and clicking it again to make the joke continue)
This meme gets reposted so often, it feels recursive
This meme gets reposted so often, it feels recursive
This meme gets reposted so often, it feels recursive
While(true)
{
RepostMeme();
SleepDays(random.next());
}
Say that again 🤨