Your "stop testing" section is gibberish and makes me think you don't understand short-circuit eval. It's not helping you mixed and matched yodish with non-yodish.

In your case, if X is 5 or less, it WILL short circuit out right there not running the x<10 anyways, there is NO reason to split it into two IF the way you do in the second snippet. That's what short-cicruit DOES when it's &&. It already knows its going to be false, so it skips out!

Or am I misunderstanding what you're trying to say, and the second part is an example of what it's doing, not a rewrite to be "better"?

Because it isn't.

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store