Purely in technical terms, this meme doesn’t really fit unless they start running literally from the edge.
While and do while are equal except for the very first test. So if the very first test does not evaluate to false, they are essentially same. In the meme that implies they started running sometime before reaching the edge, that runs the “run()” atleast once and later on for every run it would be checked and it would be false at the cliff edge.
Purely in technical terms, this meme doesn’t really fit unless they start running literally from the edge.
While and do while are equal except for the very first test. So if the very first test does not evaluate to false, they are essentially same. In the meme that implies they started running sometime before reaching the edge, that runs the “run()” atleast once and later on for every run it would be checked and it would be false at the cliff edge.
Years ago when this meme first came my way I tried to explain this and nobody agreed with me, it was driving me mad.
do { explain } while ( !they.understand )
do { say("I use Arch btw"); } while ( they.interested );
This loop never runs twice.
Finally a correct application for the do-while meme!
Ruby has a fun
until
for refuted conditionals!until(they.understand) { explain }
Reads like English 🙃
Yeah I ran through the logic in my mind and got confused, came to the comments to ask what I was missing
Yep, replace edge with isOnGround or something
Actually, doesn’t change the matter.
Yep, needs to check if the next step has ground, otherwise you’re already falling.