What is short-circuit evaluation

Blitz3D – the only language where you can get a significant performance boost by changing

If (someValue < 1.0 And SomeExpensiveCalculation()) Then 
    DoSomething()
EndIf

to

If (someValue < 1.0) Then
    If (SomeExpensiveCalculation()) Then
        DoSomething()
    EndIf
EndIf

5376246

FacebookTwitterTumblrGoogle+Share

6 comments

    1. Luckily this isn’t really indicative of the state of language design, just a quirk of one obscure BASIC variant.

    1. I’m working on a few small-ish additions to Containment Breach on the side, but Barotrauma is still going strong. There’s been quite a lot of progress since the last version, won’t be long before another update.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>