Lably
Skip to content

Expression (computer science)

Syntactic entity in a programming language with a determinable value

  • 3 min read
  • 4 chapters
  • 1 lab on Lably

Learn it on Lably

Expressions are often contrasted with statements—syntactic entities that have no value (an instruction).

Definition

Like in mathematics, an expression is used to denote a value to be evaluated for a specific value type supported by a programming language. In some cases an expression can't be fully evaluated; in this case, the value is undefined, even though the calculation was effected and finished.

The process of evaluating an expression to a well-defined value type is called evaluation; it can occur in different contexts, such as definition and initialization .

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication