Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeConcepts
Conditional

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 Conditional
21 documented Misconceptions

Any LanguageJavaJavaScriptPythonScratch
Check Yourself
Misconception
BaseCaseNotNeeded
Recursive computations do not necessarily need a base case
Misconception
ConditionalIsSequence
If-else is equivalent to sequence of two ifs
Misconception
ElsIf
There is an elsif keyword for multi-way conditional statements
Misconception
ElseAlwaysExecutes
The else branch of an if-else statement always executes
Misconception
ForIsConditional
The body of a for statement executes at most once
Misconception
IfIsLoop
The body of an if statement executes repeatedly, as long as the condition holds
Misconception
IfRequiresElse
Every if statement requires an else
Misconception
LoopTerminatingCondition
For and while loops end when the condition becomes true
Misconception
MapToBooleanWithConditionalOperator
To map a boolean expression to a boolean, a conditional operator is necessary
Misconception
MapToBooleanWithIf
To map a boolean expression to a boolean, an if statement is necessary
Misconception
RecursiveMethodNeedsIfElse
A recursive method needs to contain an if-else statement

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors