Savage///Chats

General Forums => Tech Humor => Topic started by: Chris Savage on Mar 22, 2025, 11:18 PM

Title: Road Runner Program Logic
Post by: Chris Savage on Mar 22, 2025, 11:18 PM
As a programmer, I like this!

d786237a9e794092.jpg

Source (https://mastodon.sdf.org/@capngloval/114207591773472991)
Title: Re: Road Runner Program Logic
Post by: JKnightandKARR on Mar 23, 2025, 06:20 PM
Lol. Is that the point in the code where it crashed??
Title: Re: Road Runner Program Logic
Post by: granz on Mar 23, 2025, 06:53 PM
Quote from: JKnightandKARR on Mar 23, 2025, 06:20 PMLol. Is that the point in the code where it crashed??
LOL - Good one.
Title: Re: Road Runner Program Logic
Post by: Chris Savage on Mar 23, 2025, 09:48 PM
Quote from: JKnightandKARR on Mar 23, 2025, 06:20 PMLol. Is that the point in the code where it crashed??

Could be. The example is more BASIC (pun intended) by demonstrating that, depending on when your conditional is executed, you could end up executing more code than you expect (that's overly simplifying it).

In the graphic, the Roadrunner example is he evaluates his conditional BEFORE executing commands. The coyote on the other hand executes THEN checks the conditional evaluation, which may have returned a FALSE (meaning it should NOT have run).
Title: Re: Road Runner Program Logic
Post by: JKnightandKARR on Mar 25, 2025, 01:42 AM
Quote from: granz on Mar 23, 2025, 06:53 PM
Quote from: JKnightandKARR on Mar 23, 2025, 06:20 PMLol. Is that the point in the code where it crashed??
LOL - Good one.
I thought so.

Quote from: Chris Savage on Mar 23, 2025, 09:48 PM
Quote from: JKnightandKARR on Mar 23, 2025, 06:20 PMLol. Is that the point in the code where it crashed??

Could be. The example is more BASIC (pun intended) by demonstrating that, depending on when your conditional is executed, you could end up executing more code than you expect (that's overly simplifying it).

In the graphic, the Roadrunner example is he evaluates his conditional BEFORE executing commands. The coyote on the other hand executes THEN checks the conditional evaluation, which may have returned a FALSE (meaning it should NOT have run).
I know, that's why I asked, since the coyote is going to end up crashing into the ground below. lol