Control Flow
The control flow is the path of execution through a program.
Related concepts: SequenceConditionalLoop
Closest Wikipedia entry: Control flow
Misconceptions about Control Flow28 documented Misconceptions
Check YourselfCatchAlwaysExecutes — Java
Catch blocks always get executedCatchProvidesOptions — Java
Only the part of a catch block necessary to fix the cause of an exception is executedConditionalIsSequence — Java
If-else is equivalent to sequence of two ifsDeferredReturn — Java
A return statement in the middle of a method doesn't return immediatelyElsIf — Java
There is an elsif keyword for multi-way conditional statementsElseAlwaysExecutes — Java
The else branch of an if-else statement always executesForIsConditional — Java
The body of a for statement executes at most onceIfIsLoop — Java
The body of an if statement executes repeatedly, as long as the condition holdsIfRequiresElse — Java
Every if statement requires an elseLoopTerminatingCondition — Java
For and while loops end when the condition becomes trueNoShortCircuit — Java
&& and || always evaluate both operandsPreIncrementBeforeLoop — Java
Pre-increment in update part of for loop means increment before loop bodyRecursiveMethodNeedsIfElse — Java
A recursive method needs to contain an if-else statementTryCatchMandatory — Java
When a piece of code can throw an exception, it must be surrounded with a try/catch blockTryFinishes — Java
Exceptions get thrown at the end of the try blockConditionalOperatorNotExpression — JavaScript
The conditional operator is not an expressionConditionalIsSequence — Python
If-else is equivalent to sequence of two ifsDeferredReturn — Python
A return statement in the middle of a function doesn't return immediatelyIfIsLoop — Python
The body of an if-statement executes repeatedly, as long as the condition holdsNoShortCircuit — Python
and/or always evaluate both operandsOutsideInFunctionNesting — Python
Nested function calls are invoked outside inRecursiveFunctionNeedsIfElse — Python
A recursive function needs to contain an if-else statementRightToLeftChaining — Python
Chained accesses are invoked from right to leftConditionalIsSequence — Scratch
If-then-else block is equivalent to sequence of two if-then blocksElseAlwaysExecutes — Scratch
The else branch of an if-then-else block always executesMissingElseTerminates — Scratch
Blocks following an if without else will not execute if the condition is falseRepeatDistributes — Scratch
Each block in a loop is repeated individuallyResetStateEachLoopIteration — Scratch
The computation of all loop iterations starts from the state before the loop