Expression
An expression is a syntactic construct in a programming language that evaluates to a value or designates an object, and may also cause side effects.
Building User-Friendly DSLs
A domain-specific-language syntactic construct whose instances evaluate to values of specified types.
- How it is used
- Expresses detailed business logic for calculations, conditions, and outcomes over domain values.
- How deep it goes
- Defines expressions, develops binary-operation ASTs and runtime generation, and defers order of operations to later treatment.
- Examples
- Uses Rental price-after-discount calculation, Number values, Attribute References, generated JavaScript getters, and a read-only form field.
- What you can do after
- Build it from scratch by adding expression concepts and generating computed runtime values from their ASTs.
Get Programming: Learn to code with Python
A combination of values, names, and operators that evaluates to a single result in a program.
- How it is used
- Uses expressions to calculate values for assignments and to supply values to `print()`.
- How deep it goes
- Defines evaluation through substitution and examples, then distinguishes expressions from statements without descending into interpreter internals.
- Examples
- Works through `c = a + b` and checks arithmetic, assignment, and printed expressions.
- What you can do after
- Practice/perform it: Evaluate expressions, use their results in assignments or `print()`, and distinguish them from statements that only perform actions.
Read how Get Programming: Learn to code with Python explains expression →
F# in Action: A Revised Edition of Get Programming with F#
An expression is a program construct that evaluates to a value.
- How it is used
- Frames application logic as transformations of values rather than sequences of mutable assignments.
- How deep it goes
- Explains conditional expressions, uniform branch types, compiler checks, and function extraction without treating advanced functional-programming theory.
- Examples
- Uses age classification and greeting generation, a gas-driving conditional, and email validation results.
- What you can do after
- Apply it by writing value-returning conditionals and extracting calculations from output-oriented code.
Read how F# in Action: A Revised Edition of Get Programming with F# explains expression →
The Well-Grounded Rubyist, Fourth Edition
A Ruby expression is syntactic code that can be evaluated to produce a value, including code continued across multiple lines.
- How it is used
- Explains what irb displays and what Ruby tests when an expression appears in a condition.
- How deep it goes
- Works through assignment, method calls, definitions, and conditional results; does not descend into interpreter internals.
- Examples
- Uses irb arithmetic, multiline addition, assignment, class and method definitions, and a `puts` call inside `if`.
- What you can do after
- Diagnose/debug with it by separating an expression’s result, visible output, and behavior in a conditional test.
Read how The Well-Grounded Rubyist, Fourth Edition explains expression →
Modern C
An expression is a C syntactic construct that is evaluated to produce a value and may modify program state.
- How it is used
- Uses expressions to perform arithmetic, compare values, modify objects, select conditionally, and control evaluation order.
- How deep it goes
- Defines value, object, and type operators with examples, then examines side effects and optimization without exhausting every operator rule.
- Examples
- Uses arithmetic assignment, prefix and postfix increments, compound assignments, printf observation, and scalar or aggregate initializers.
- What you can do after
- Evaluate expressions as value and state transitions, and recognize when side effects or optimization affect their behavior.
Write Powerful Rust Macros
A Rust expression is a syntactic construct that evaluates to a value.
- How it is used
- Uses expressions as precise inputs and results when defining declarative macro matchers and expansions.
- How deep it goes
- Explains expression capture, metavariable syntax, block grouping, and the trade-off between expr precision and tt breadth.
- Examples
- Demonstrates expression capture through vector-building macros and greeting macros that expand to function calls or braced blocks.
- What you can do after
- Apply expression matchers to accept computed macro inputs and return multi-statement expansions as single expressions.
Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools
An expression is a PowerShell combination of values, variables, operators, and syntax that evaluates to a result such as True or False.
- How it is used
- Guides conditional decisions in PowerShell automation through If and Switch constructs.
- How deep it goes
- Defines Boolean results and demonstrates comparisons, compound conditions, branch selection, and expression testing.
- Examples
- Uses variable comparisons, date-and-time conditions, process thresholds, compound tests, and wildcard Switch matching.
- What you can do after
- Diagnose/debug with the interactive PowerShell console before assembling expressions into larger scripts.
Python Workout: 50 ten-minute exercises
An expression is a syntactic construct that Python evaluates to produce a value.
- How it is used
- Uses expressions to transform sequence elements, select outputs, and compute values during string formatting.
- How deep it goes
- Explains expressions through comprehensions and f-strings with runnable examples, without treating Python expression syntax or internals comprehensively.
- Examples
- Demonstrates squaring even numbers, mapping word lengths, filtering long words, and computing values inside formatted strings.
- What you can do after
- Apply expressions through comprehensions and f-strings to transform data, filter results, and format computed values.
Read how Python Workout: 50 ten-minute exercises explains expression →
Python Workout, Second Edition
An expression is Python syntax that evaluates to a value.
- How it is used
- Uses expressions to transform iterable elements, filter outputs, and construct lists or dictionaries with comprehensions.
- How deep it goes
- Explains expressions through comprehension structure and contrasts returned values with for-loop commands and side effects.
- Examples
- Uses squared even numbers, mapped word lengths, filtered words, and key-value dictionary construction as concrete examples.
- What you can do after
- Apply expressions to build transformed or filtered collections and select comprehensions or loops according to the desired result.
Read how Python Workout, Second Edition explains expression →
Python How-To
An expression is a syntactic form in Python that can be evaluated to produce a value.
- How it is used
- Uses expressions to interpolate computed values into strings and to form the bodies of lambda functions.
- How deep it goes
- Defines evaluation versus action, then demonstrates f-string readability and lambda syntax without pursuing Python evaluation internals.
- Examples
- Demonstrates list lookup, method calls, arithmetic, average-score formatting, and a doubling lambda.
- What you can do after
- Apply expressions in f-strings and lambda functions while separating complicated calculations into readable steps.
Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS
An expression is a PowerShell construct that evaluates to a value.
- How it is used
- Shapes formatted command output and evaluates arithmetic values for interactive PowerShell work.
- How deep it goes
- Explains expressions through arithmetic, variables, formatting hash tables, and type conversion, but defers deeper operator coverage.
- Examples
- Demonstrates formulas, variable assignment, process memory conversion, custom column labels, and formatted process listings.
- What you can do after
- Apply expressions via PowerShell commands to calculate values, assign results, filter input, and improve formatted output.
Related concepts
- conditional logicincludes · Conditional logic is a programming technique that selects execution paths, actions, or result values according to evaluated conditions.
- return valueproduces · A return value is the result produced by a function, method, or operation and supplied to the code that invoked it.
- statementkind of · A statement is a syntactic program construct that performs an action, declaration, or control operation without necessarily producing an expression value.
- aritymeasured by · Arity is the number of arguments or operands accepted by a function, method, operator, or other operation.
- Objectproduces · java.lang.Object is the root class of Java’s reference-type hierarchy and defines methods inherited by Java reference types.
- check constraintused by · A CHECK constraint is a database rule requiring each inserted or updated row or constrained value to satisfy a specified Boolean condition.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.










