What Are Expressions?
A key ingredient to every programming language’s expressiveness stems from the use of expressions. In fact, some languages are (almost) entirely based on this concept. C# isn’t that extreme though. But what are expressions? According to the language specification:
An expression is a sequence of operators and operands.
First, it’s important to notice expressions typically denote a value by means of some computation. This is achieved by having operators operate on one or more operands, carrying out the desired computation. Because expressions represent a value, they also do have a type.
Examples of operators include arithmetic operators, comparison operators, and so on. Operands can be variables, literals, or even other expressions. ...
Get C# 5.0 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.