Boolean
A Boolean is a logical value or data type representing truth or falsity, conventionally with the two values true and false.
100 C++ Mistakes and How to Avoid Them
A Boolean value represents one of two logical states, conventionally false and true.
- How it is used
- Uses Boolean values to express truth states, select function behavior, and return predicate results.
- How deep it goes
- Explains integer and enumeration alternatives, toggling, flag readability, and direct returns through contrasting code examples.
- Examples
- Uses an integer toggle, a zero-filtering flag, and an even-number predicate to illustrate common mistakes and corrections.
- What you can do after
- Apply Boolean values in C++ by toggling explicitly, choosing clearer function interfaces, and returning predicate results directly.
Read how 100 C++ Mistakes and How to Avoid Them explains boolean →
The Well-Grounded Rubyist, Fourth Edition
A truth value is the Boolean interpretation Ruby assigns to an object when it is used as a condition.
- How it is used
- Uses truth values to decide whether conditional code runs, including when a method reports ticket availability.
- How deep it goes
- Distinguishes an expression’s resulting object from its truth value through worked conditional tests and a comparison table.
- Examples
- Tests ticket availability, zero, empty strings, class and method definitions, comparisons, and `puts` return values.
- What you can do after
- Evaluate/understand why a Ruby condition passes or fails without mistaking a truth value for the object `true`.
Read how The Well-Grounded Rubyist, Fourth Edition explains boolean →
The Quick Python Book, Fourth Edition
A boolean value is a truth-valued value that is either true or false.
- How it is used
- Uses Boolean values and object truth tests to control conditional execution.
- How deep it goes
- Explains truth testing, comparisons, operand-returning logical operators, and short-circuiting; defers detailed precedence rules to documentation.
- Examples
- Demonstrates a chained range test and logical expressions returning lists or numbers.
- What you can do after
- Evaluate/understand Python truth tests and predict which operand a logical expression returns.
Read how The Quick Python Book, Fourth Edition explains boolean →
API Design Patterns
A boolean is a primitive data type whose value is one of two logical states, typically true or false.
- How it is used
- Uses booleans for flags and simple yes-or-no resource properties such as archiving, chatbot access, and soft deletion.
- How deep it goes
- Explains representation, naming, missing-value semantics, output-only behavior, and when state fields should replace boolean flags.
- Examples
- Uses ChatRoom fields for archiving and chatbot access, plus an output-only deleted field for soft deletion.
- What you can do after
- Apply it via resource APIs by choosing positive flag names, modeling evolving categories explicitly, and enforcing output-only transitions.
Tiny Python Projects: Learn coding and testing with puzzles and games
A Boolean value is one of the two truth values, True or False, used to represent logical conditions.
- How it is used
- Uses truth values to test strings, enforce game rules, and represent program state.
- How deep it goes
- Explains comparisons, membership, case normalization, and combining conditions, but does not descend into Boolean implementation internals.
- Examples
- Demonstrates vowel detection, uppercase normalization, comparison output, and Tic-Tac-Toe winner checks.
- What you can do after
- Apply it via Python comparisons, membership tests, and logical operators to evaluate conditions in small programs.
Read how Tiny Python Projects: Learn coding and testing with puzzles and games explains boolean →
Modern C, Third Edition
bool is a C type whose values represent logical truth and falsity.
- How it is used
- Uses bool to store truth values and conditional expressions to control execution.
- How deep it goes
- Defines bool values and representation constraints, but defers broader type details to the Boolean data type treatment.
- Examples
- Demonstrates direct bool conditions, nonzero numerical conditions, and a loop that skips index zero.
- What you can do after
- Apply bool directly in conditions and avoid redundant comparisons while preserving valid Boolean representations.
Acing the CCNA Exam: Volume 2 Advanced Networking and Security
A JSON Boolean is a primitive data type with one of two values, true or false.
- How it is used
- Represents binary state in JSON data exchanged between applications and commonly supported by REST APIs.
- How deep it goes
- Defines two values, lowercase syntax, and quoted-value distinctions, without descending into implementation internals.
- Examples
- Uses interface status, device configuration, quoted "true", and invalid uppercase TRUE to distinguish Boolean syntax.
- What you can do after
- Evaluate JSON values and identify Boolean syntax errors in configuration data and exam-style examples.
Read how Acing the CCNA Exam: Volume 2 Advanced Networking and Security explains boolean →
Python How-To
A boolean value is a truth value representing one of two logical states, true or false, in Python.
- How it is used
- Uses truth values to validate strings, filter iterables, test collection overlap, and represent state in JSON data.
- How deep it goes
- Defines True and False and demonstrates predicates, truthiness, filtering, and short-circuit evaluation without descending into implementation internals.
- Examples
- Demonstrates username validation, numeric-string checks, stock-list overlap, urgent-task filtering, and JSON Boolean values.
- What you can do after
- Apply it via predicates, `bool`, set operations, and `filter` to validate data, detect matches, and select items.
Essential TypeScript 5, Third Edition
The boolean type is the JavaScript and TypeScript type whose values are true or false.
- How it is used
- Uses booleans to represent binary decisions, inspect runtime values, control fallbacks, and describe asserted types.
- How deep it goes
- Explains definition, inference, coercion, fallback operators, and assertion limits, but stops short of deeper boolean implementation details.
- Examples
- Demonstrates typeof output, price comparison, fallback tax rates, nullish coalescing, and an unsafe calculateTax assertion.
- What you can do after
- Apply via JavaScript operators and TypeScript assertions while recognizing when runtime values do not match declared boolean types.
Read how Essential TypeScript 5, Third Edition explains boolean →
Modern C
bool is the C standard boolean type whose values represent false or true.
- How it is used
- Controls conditional execution and stores values explicitly intended to represent truth.
- How deep it goes
- Defines truth rules, header names, representations, and assignment behavior without developing deeper implementation details.
- Examples
- Uses if (i), equality comparisons, and bool b conditions to contrast direct truth testing with redundant comparisons.
- What you can do after
- Apply Boolean values through stdbool.h and write clearer conditions without redundant truth comparisons.
Building User-Friendly DSLs
A value or type with one of two truth values, true or false.
- How it is used
- Uses boolean values to validate conditions in business rules within a domain-specific language.
- How deep it goes
- Defines the type, registers it, and type-checks rule conditions, but does not implement logical-expression evaluation.
- Examples
- Uses a built-in boolean type and a business-rule condition checked against that type.
- What you can do after
- Build it from scratch by adding boolean type registration and validating business-rule conditions against it.
Also covered in
- The Design of Web APIs, Second Edition
- React Quickly, Second Edition
- React in Depth
- Elixir in Action, Third Edition
- Rust in Action: Systems programming concepts and techniques
- Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS
- Robotics for ProgrammersIn early access (MEAP)
- JavaScript in DepthIn early access (MEAP)
- Go in Action, Second Edition
- PostgreSQL Mistakes and How to Avoid Them
- Elasticsearch in Action, Second Edition
- Pro Angular 16
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.
- stringA string is a programming-language value representing textual data as an ordered sequence of characters or encoded units.
- expressionAn expression is a syntactically formed combination of values, names, operators, or other terms that denotes or evaluates to a value or result.
- falseFalse is the Boolean value representing logical falsity.
Related concepts
- primitive typekind of · A primitive type is a predefined basic data type representing a simple value rather than a composite structure of multiple values or fields.
- conditional logicproduced by · Conditional logic is a programming technique that evaluates conditions to select among execution paths, actions, or result values.
- membership operatorproduced by · A membership operator is a language construct that tests whether a specified value or property is present in a supported collection, range, or object.
- predicateproduced by · A predicate is a condition or relation over values or entities that specifies whether a stated property holds.
- atomkind of · An atom is an Elixir named constant whose text is stored in the runtime atom table and whose value is a reference to that text.
- equalityproduced by · Equality is a relation or operation that determines whether two values are considered equivalent according to applicable comparison rules.
Questions about boolean
What is boolean?
A Boolean is a logical value or data type representing truth or falsity, conventionally with the two values true and false.
Which Manning books explain boolean?
100 C++ Mistakes and How to Avoid Them, The Well-Grounded Rubyist, Fourth Edition, The Quick Python Book, Fourth Edition, API Design Patterns, Tiny Python Projects: Learn coding and testing with puzzles and games, Modern C, Third Edition, Acing the CCNA Exam: Volume 2 Advanced Networking and Security, Python How-To and 3 more.
What should I know before learning boolean?
Manning books that teach boolean usually introduce function, string, expression and false first.
What is boolean a kind of?
Boolean is a kind of primitive type. A primitive type is a predefined basic data type representing a simple value rather than a composite structure of multiple values or fields.
What is boolean also called?
Boolean is also called bool.
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.










