Expression
An expression is a syntactically formed combination of values, names, operators, or other terms that denotes or evaluates to a value or result.
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
- Uses value-producing conditionals to calculate results without repeated assignment to mutable variables.
- How deep it goes
- Explains expression results, same-type branches, omitted `return`, and compiler-checked `else` cases through worked code.
- Examples
- Contrasts C# age-description assignments with an F# conditional and an extracted description function.
- What you can do after
- Practice/perform rewriting conditional assignments as a value-producing F# expression and extracting it into a reusable function.
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
- Computes values from operands and can modify objects through assignment and increment operators.
- How deep it goes
- Explains intermediate values, state changes, observability, optimization, and prefix versus postfix results, while treating many operators briefly.
- Examples
- Uses arithmetic assignments, printed results, prefix and postfix increments, and expressions in scalar initializers.
- What you can do after
- Evaluate expressions as intermediate values and state changes, and distinguish prefix from postfix results.
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.
Secrets of the JavaScript Ninja, Third Edition
An expression is a JavaScript construct that evaluates to a value and can occur within a larger expression or statement.
- How it is used
- Distinguishes standalone function declarations from function expressions embedded in assignments, calls, and other statements.
- How deep it goes
- Explains function-expression placement and concise arrow-function bodies, without surveying expression types generally.
- Examples
- Uses greeting and hypotenuse functions to compare arrow syntax with function expressions.
- What you can do after
- Understand how function expressions fit into assignments, calls, and concise arrow-function definitions.
Read how Secrets of the JavaScript Ninja, Third Edition explains expression →
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 →
Julia as a Second Language
An expression is a Julia construct that evaluates to a value, including constructs such as arithmetic operations, assignments, and loops.
- How it is used
- Uses evaluated values to explain Julia syntax through REPL experiments and control-flow examples.
- How deep it goes
- Defines expressions through evaluated values and demonstrates arithmetic, assignments, loops, and conditional blocks with short examples.
- Examples
- Uses arithmetic, an assignment, an empty while loop, and an if-else expression as concrete examples.
- What you can do after
- Understand how arithmetic, assignments, and control-flow constructs evaluate to values, including `nothing` for a while loop.
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.
Web Component Development with Modern Libraries and Tooling
A JavaScript syntactic construct that evaluates to a value.
- How it is used
- Uses expressions to bind component properties to markup, attributes, CSS, and derived values.
- How deep it goes
- Explains reactive recomputation, duplicate-expression sharing, input timing, and several ways to calculate derived values.
- Examples
- Demonstrates sliders, a color picker, a reactive rectangle, CSS dimensions, and a computed rectangle area.
- What you can do after
- Apply expressions via wrec to create reactive text, attributes, CSS values, and computed component properties.
Read how Web Component Development with Modern Libraries and Tooling explains expression →
Also covered in
- Grokking AI Applications
- Learn SQL in a Month of Lunches
- Math for Web Design
- How Computers Make Books
- Kotlin in Action, 2E
- Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu
- Grokking Web Application Security
- Functional Programming in C#, Second Edition
- GitHub Actions in Action: Continuous integration and delivery for DevOps
- Elixir in Action, Third Edition
- How Large Language Models Work
- PostgreSQL Mistakes and How to Avoid Them
What to know first
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- conditional logicConditional logic is a programming technique that evaluates conditions to select among execution paths, actions, or result values.
- arrayAn array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
- booleanA Boolean is a logical value or data type representing truth or falsity, conventionally with the two values true and false.
Related concepts
- conditional logicincludes · Conditional logic is a programming technique that evaluates conditions to select among execution paths, actions, or result values.
- statementcontrasts with · A statement is a syntactic unit in a programming or query language that expresses an instruction, declaration, or control operation for a processor to execute.
- aritymeasured by · Arity is the number of arguments or operands an operation accepts.
- binary expressionincludes · A binary expression applies a binary operator to exactly two operand expressions.
- 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.
- Objectproduces · java.lang.Object is the root class of Java’s reference-type hierarchy and defines methods inherited by Java reference types.
Questions about expression
What is expression?
An expression is a syntactically formed combination of values, names, operators, or other terms that denotes or evaluates to a value or result.
Which Manning books explain expression?
Building User-Friendly DSLs, Get Programming: Learn to code with Python, F# in Action: A Revised Edition of Get Programming with F#, The Well-Grounded Rubyist, Fourth Edition, Modern C, Write Powerful Rust Macros, Secrets of the JavaScript Ninja, Third Edition, Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools and 6 more.
What should I know before learning expression?
Manning books that teach expression usually introduce function, conditional logic, array and boolean first.
What is the difference between expression and statement?
An expression is a syntactically formed combination of values, names, operators, or other terms that denotes or evaluates to a value or result. A statement is a syntactic unit in a programming or query language that expresses an instruction, declaration, or control operation for a processor to execute.
What kinds of expression are there?
Kinds of expression include conditional logic and binary expression.
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.













