liveBook · Manning

Runtime logic error

A runtime logic error is a defect in a program’s computation or control logic that causes incorrect behavior during execution, even though the program runs.

How 3 Manning books explain it

Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools

A logic bug is a defect in which a program's operations produce an unintended result because a value, property, or variable differs from the programmer's assumption.

How it is used
Diagnoses PowerShell scripts whose commands run but produce incorrect behavior because values or properties violate program assumptions.
How deep it goes
Explains expectation checking, value inspection, breakpoints, and stepping through conditionals, while deferring advanced breakpoint techniques.
Examples
Uses a Get-DiskInfo function, CIM disk data, a mismatched DriveType value, and a VS Code breakpoint walkthrough.
What you can do after
Diagnose logic errors by inspecting values, setting breakpoints, stepping through decisions, and locating expectation mismatches.

Read how Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools explains runtime logic error →

Learn Rust in a Month of Lunches

A logic bug is a defect in a program's intended behavior that does not necessarily prevent the code from running.

How it is used
Uses explicit failures and tests to expose behavior that compiles and runs but violates the program’s intended rules.
How deep it goes
Demonstrates vector invariants, assertion macros, and failure messages, while deferring broader strategies for replacing development-time panics.
Examples
Uses a three-item vector, an accidentally longer vector, assertion failures, and missing Option values as concrete failure cases.
What you can do after
Diagnose/debug with panic!, assertions, and tests that reveal violated assumptions or unintended behavior.

Read how Learn Rust in a Month of Lunches explains runtime logic error →

Code Like a Pro in Rust

A logic error is a defect in a program's intended computation that can produce incorrect results even when the program compiles and runs.

How it is used
Frames unit testing as the primary defense against incorrect computations that compilation cannot detect.
How deep it goes
Defines the compiler boundary and gives a division-versus-multiplication example, without developing a broader error taxonomy.
Examples
Uses mistaken division instead of multiplication and recommends small, stateless, deterministic functions as testable units.
What you can do after
Diagnose logic errors with unit tests and reduce them by structuring computation into small, deterministic functions.

Read how Code Like a Pro in Rust explains runtime logic error →

Related concepts

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.