DRAFT
Observed
The else branch of an if-else statement always executes
The else branch of an if-else statement only executes if the condition evaluates to false
In an if-else-statement, only one of the two branches executes.
if (a) {
a();
} else {
b();
}
is different from
if (a) {
a();
}
b();
if (a) {
a();
} else if (b) { // else means this condition only executes if `!a`
b();
} else {
c();
}
is different from
if (a) {
a();
} // no else, so next statement doesn't depend on `a`
if (b) {
b();
} else {
c();
}
The following papers directly or indirectly provide qualitative or quantitative evidence related to this misconception.