Expression
An expression is a piece of source code that produces a value at runtime.
Related concepts: EvaluationValue
Closest Wikipedia entry: Expression (computer science)
Misconceptions about Expression48 documented Misconceptions
Check YourselfArithmeticPlusPrecedes — Java
Addition has higher precedence than string concatenationAssignCompares — Java
= compares two valuesAssignmentNotExpression — Java
An assignment a=b is not an expressionCannotChainMemberAccesses — Java
Member accesses cannot be chained togetherCannotChainMemberToConstructor — Java
Method calls or field accesses cannot be chained to a constructor invocationChainedMethodsNotCalledFromOutside — Java
Chained methods are all called on the object at the beginning of the chainComparisonWithBooleanLiteral — Java
To test whether an expression is true or false, one must compare it to true or to falseCompositeExpressionsUntyped — Java
Expressions that consist of multiple parts have no typeEqualityOperatorComparesObjectsValues — Java
o==p compares the objects referred to by variables o and pEqualsComparesReferences — Java
o.equals(p) compares the references stored in the variables o and pExpressionAssigns — Java
An expression that reads a variable also updates its value after the evaluationExpressionsDynamicallyTyped — Java
One has to evaluate an expression to determine its typeLargeIntegerLong — Java
Large integer numbers have type longLiteralNoExpression — Java
A literal is not an expressionMapToBooleanWithConditionalOperator — Java
To map a boolean expression to a boolean, a conditional operator is necessaryNoAtomicExpression — Java
Expressions must consist of more than one pieceNoShortCircuit — Java
&& and || always evaluate both operandsObjectsMustBeNamed — Java
A variable is needed to instantiate an objectOutsideInMethodNesting — Java
Nested method calls are invoked outside inParenthesesOnlyIfArgument — Java
() are optional for method calls without argumentsRightToLeftChaining — Java
Chained accesses are invoked from right to leftStringPlusStringifiesExpression — Java
String concatenation stringifies non-String operand expressionsTargetTyping — Java
The type of a numerical expression depends on the type expected by the surrounding contextThisNoExpression — Java
The name this is not an expressionVariablesHoldExpressions — Java
= stores an expression in a variableArrowFunctionNoImpliedReturn — JavaScript
Even when an arrow function consists just of an expression, the return keyword must be explicitly writtenArrowFunctionRequiresFunctionKeyword — JavaScript
Arrow functions also require the keyword 'function'ConditionalOperatorNotExpression — JavaScript
The conditional operator is not an expressionIdentifierAsStringInBracketNotation — JavaScript
An identifier used to access a property with the bracket notation is treated as a stringMandatoryAssignment — JavaScript
An expression must be assigned to have a valid statementNoAtomicExpression — JavaScript
Expressions must consist of more than one pieceNoFunctionCallsChaining — JavaScript
It is not allowed to chain function callsAssignCompares — Python
= compares two valuesCannotChainAttributeToObjectInstantiation — Python
Method calls, and attribute accesses in general, cannot be chained to a constructor invocation.ComparisonWithBoolLiteral — Python
To test whether an expression is True or False, one must compare it to True or to FalseMapToBooleanWithTernaryOperator — Python
To map a boolean expression to a bool, a ternary conditional operator is necessaryNoAtomicExpression — Python
Expressions must consist of more than one pieceNoShortCircuit — Python
and/or always evaluate both operandsObjectsMustBeNamed — Python
A variable is needed to instantiate an objectOutsideInFunctionNesting — Python
Nested function calls are invoked outside inParenthesesOnlyIfArgument — Python
() are optional for function calls without argumentsPlusConcatenatesNumbers — Python
The plus operator can concatenate strings and numbersRightToLeftChaining — Python
Chained accesses are invoked from right to leftSelfNoExpression — Python
The name self is not an expressionVariablesHoldExpressions — Python
= stores an expression: it stores a reference to the expression in a variableCompareBooleanToConstant — Scratch
To test whether an expression evaluates to true or false, one must compare it to a constantEqualityOperatorComparesListIdentities — Scratch
(list a) = (list b) compares the identities of list a and list bExpressionAssigns — Scratch
An expression that reads a variable also updates its value after the evaluation