ElseAlwaysExecutes
DRAFT
Not Observed

Misconception:

An if-then-else block is equivalent to a sequence of an if-then block followed by the body of the else.

Incorrect

The else branch of an if-then-else block always executes

Correct

The else branch of an if-then-else block only executes if the condition evaluates to false

Correction
Here is what's right.

In an if-then-else block, only one of the two branches executes.

Simple Example

With the following script, the sprite will either say “a” or it will say “b”. This means it will not always say “b”.

The following script is different. The sprite will either say “a” immediately followed by “b”, or it will say “b”. This means it will always say at least “b”:

More Complex Example

is different from

Origin
Where could this misconception come from?

NOTE — We are not aware of repeated observations of this misconception in Scratch. We documented it, for completeness, based on observations of an equivalent misconception in other languages.

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.