Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeConcepts
Control Flow

Control Flow

The control flow is the path of execution through a program.

Related concepts:  SequenceConditionalLoop

Closest Wikipedia entry:  Control flow

Misconceptions about Control Flow
28 documented Misconceptions

Any LanguageJavaJavaScriptPythonScratch
Check Yourself
Misconception
CatchAlwaysExecutes
Catch blocks always get executed
Misconception
CatchProvidesOptions
Only the part of a catch block necessary to fix the cause of an exception is executed
Misconception
ConditionalIsSequence
If-else is equivalent to sequence of two ifs
Misconception
DeferredReturn
A return statement in the middle of a method doesn't return immediately
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
NoShortCircuit
&& and || always evaluate both operands
Misconception
PreIncrementBeforeLoop
Pre-increment in update part of for loop means increment before loop body
Misconception
RecursiveMethodNeedsIfElse
A recursive method needs to contain an if-else statement
Misconception
TryCatchMandatory
When a piece of code can throw an exception, it must be surrounded with a try/catch block
Misconception
TryFinishes
Exceptions get thrown at the end of the try block

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors