Misconceptions

These are the misconceptions we collected so far in:

Misconception Count Does Not Imply Language Difficulty

There is no connection between the number of misconceptions listed here and the difficulty of the corresponding programming language. The effort we spent on collecting misconceptions is very different for different languages. It would be inappropriate to reason about the quality of languages based on the number of misconceptions in this collection.

AssignCompares
Python
AssignCompares
= compares two values
AssignmentCopiesObject
Python
AssignmentCopiesObject
Assignment copies the object
CannotChainAttributeToObjectInstantiation
Python
CannotChainAttributeToObjectInstantiation
Method calls, and attribute accesses in general, cannot be chained to a constructor invocation.
ComparisonWithBoolLiteral
Python
ComparisonWithBoolLiteral
To test whether an expression is True or False, one must compare it to True or to False
ConditionalIsSequence
Python
ConditionalIsSequence
If-else is equivalent to sequence of two ifs
DeferredReturn
Python
DeferredReturn
A return statement in the middle of a function doesn't return immediately
IfIsLoop
Python
IfIsLoop
The body of an if-statement executes repeatedly, as long as the condition holds
InitCreates
Python
InitCreates
__init__ must create a new object
InitReturnsObject
Python
InitReturnsObject
__init__ needs to return an object
MapToBooleanWithIf
Python
MapToBooleanWithIf
To map a boolean expression to a bool, an if statement is necessary
MapToBooleanWithTernaryOperator
Python
MapToBooleanWithTernaryOperator
To map a boolean expression to a bool, a ternary conditional operator is necessary
MultipleValuesReturn
Python
MultipleValuesReturn
Functions can return multiple values
NoAtomicExpression
Python
NoAtomicExpression
Expressions must consist of more than one piece
NoEmptyInit
Python
NoEmptyInit
__init__ must do something
NoReservedWords
Python
NoReservedWords
Every sequence of letters and digits starting with a letter or an underscore can be used as an identifier
NoSequenceRepetition
Python
DRAFT
NoSequenceRepetition
There is no operator that repeats sequences
NoShortCircuit
Python
NoShortCircuit
and/or always evaluate both operands
ObjectsMustBeNamed
Python
ObjectsMustBeNamed
A variable is needed to instantiate an object
OutsideInFunctionNesting
Python
OutsideInFunctionNesting
Nested function calls are invoked outside in
ParenthesesOnlyIfArgument
Python
ParenthesesOnlyIfArgument
() are optional for function calls without arguments
PlusConcatenatesNumbers
Python
DRAFT
PlusConcatenatesNumbers
The plus operator can concatenate strings and numbers
RecursiveFunctionNeedsIfElse
Python
RecursiveFunctionNeedsIfElse
A recursive function needs to contain an if-else statement
ReturnCall
Python
ReturnCall
Return statements need () around the return value
ReturnUnwindsMultipleFrames
Python
ReturnUnwindsMultipleFrames
A return statement can unwind multiple call stack frames
RightToLeftChaining
Python
RightToLeftChaining
Chained accesses are invoked from right to left
SelfNoExpression
Python
SelfNoExpression
The name self is not an expression
VariablesHoldExpressions
Python
VariablesHoldExpressions
= stores an expression: it stores a reference to the expression in a variable
VariablesHoldObjects
Python
VariablesHoldObjects
A variable contains a whole object

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.