Conditional
In a conditional statement or expression the value of a condition determines which alternative pieces of code to execute.
Related concepts: StatementExpressionControl Flow
Closest Wikipedia entry: Conditional (computer programming)
Misconceptions about Conditional21 documented Misconceptions
Check YourselfBaseCaseNotNeeded — Java
Recursive computations do not necessarily need a base caseConditionalIsSequence — Java
If-else is equivalent to sequence of two ifsElsIf — 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 trueMapToBooleanWithConditionalOperator — Java
To map a boolean expression to a boolean, a conditional operator is necessaryMapToBooleanWithIf — Java
To map a boolean expression to a boolean, an if statement is necessaryRecursiveMethodNeedsIfElse — Java
A recursive method needs to contain an if-else statementConditionalOperatorNotExpression — JavaScript
The conditional operator is not an expressionConditionalIsSequence — Python
If-else is equivalent to sequence of two ifsIfIsLoop — Python
The body of an if-statement executes repeatedly, as long as the condition holdsMapToBooleanWithIf — Python
To map a boolean expression to a bool, an if statement is necessaryMapToBooleanWithTernaryOperator — Python
To map a boolean expression to a bool, a ternary conditional operator is necessaryRecursiveFunctionNeedsIfElse — Python
A recursive function needs to contain an if-else statementBaseCaseNotNeeded — Scratch
Recursive computations do not necessarily need a base caseConditionalIsSequence — 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 false