liveBook · Manning

Type checking

Also called type checks

Type checking is the process of determining whether a value or program construct satisfies the constraints of a type system.

How 7 Manning books explain it

Secrets of the JavaScript Ninja, Third Edition

The process of verifying that expressions, values, and operations conform to a language's declared or inferred type rules.

How it is used
Catches predictable type mismatches before JavaScript runtime as a coding practice alongside linting and testing.
How deep it goes
Works through compiler setup, an argument-type diagnostic, and checking versus execution, but defers detailed configuration options.
Examples
Uses a string passed to a number-typed function and a `setTimeout` call with its arguments reversed.
What you can do after
Operate/configure it with `tsconfig.json` and `npx tsc`, while retaining separate checks when running type-stripped code.

Read how Secrets of the JavaScript Ninja, Third Edition explains type checking →

Kotlin in Action, 2E

A type check is a Kotlin operation that tests whether a value has a specified runtime type.

How it is used
Uses `is` to select subtype-specific behavior while safely accessing members in the successful branch.
How deep it goes
Explains smart casts and their stability constraint, then details runtime limits caused by generic type erasure.
Examples
Demonstrates recursive `Expr` evaluation, checking an `Any` value for `String`, and distinguishing lists from sets.
What you can do after
Apply `is` and smart casts for subtype handling while avoiding invalid assumptions about erased generic arguments.

Read how Kotlin in Action, 2E explains type checking →

The Quick Python Book, Fourth Edition

Type checking is the analysis of program values and operations to detect whether they conform to expected types.

How it is used
Enforces expected types in Python functions and custom collections while contrasting explicit checks with duck typing.
How deep it goes
Works through type comparisons, typed-list checks, and collection initialization, while leaving a complete list implementation unfinished.
Examples
Uses string-versus-integer comparisons, a typed list, and a string-only URL-to-page dictionary.
What you can do after
Build type checks into custom Python collections and evaluate when duck typing may offer more flexibility.

Read how The Quick Python Book, Fourth Edition explains type checking →

Type-Driven Development with Idris

Type checking is the process of verifying that a program satisfies the constraints imposed by its types.

How it is used
Verifies that implementations obey type constraints, supporting valid state transitions and guiding incremental function construction.
How deep it goes
Checks expressions against expected types after evaluating both, using equality proofs when type-level arithmetic cannot reduce far enough.
Examples
Uses ATM state transitions and vector types with arithmetic expressions to illustrate guarantees and type mismatches.
What you can do after
Diagnose type mismatches by inspecting expected types and evaluating type-level expressions in Idris’s REPL.

Read how Type-Driven Development with Idris explains type checking →

Essential TypeScript 5, Third Edition

Type checking is the analysis of program values and expressions to determine whether their types satisfy language rules.

How it is used
Uses static analysis to catch incompatible values while developing TypeScript, JavaScript integrations, and React applications.
How deep it goes
Explains annotations, inference, unions, narrowing, object shapes, and configuration, while stopping short of compiler implementation internals.
Examples
Uses a cart formatter receiving strings, an ensuing toFixed runtime error, and a React tsconfig with strict and noEmit.
What you can do after
Diagnose/debug with it by identifying unchecked JavaScript boundaries and separating TypeScript type errors from Babel transformation.

Read how Essential TypeScript 5, Third Edition explains type checking →

Julia as a Second Language

Type checking is the process of verifying that operations are applied to compatible types.

How it is used
Uses runtime checks to constrain Julia method arguments and fields while retaining flexibility through type parameters.
How deep it goes
Contrasts static and runtime checks and works through parametric methods; defers further detail on field annotations’ performance implications.
Examples
Demonstrates an integer-vector search with a string mismatch and a two-dimensional vector with annotated displacement fields.
What you can do after
Apply type checking through Julia parametric methods and field annotations to constrain search arguments and vector fields.

Read how Julia as a Second Language explains type checking →

Refactoring to Rust

Type checking is the process of verifying that values and operations conform to the rules of a type system.

How it is used
Uses typed Rust structs to validate JSON data during deserialization.
How deep it goes
Explains inference, trait requirements, and runtime mismatch errors, but defers broader Serde configuration options.
Examples
Demonstrates typed `Data` structs, compiler diagnostics, and a JSON string whose `name` field incorrectly contains text.
What you can do after
Diagnose JSON type mismatches using compiler messages and Serde's line-and-column runtime errors.

Read how Refactoring to Rust explains type checking →

Also covered in

What to know first

Related concepts

Questions about type checking

What is type checking?

Type checking is the process of determining whether a value or program construct satisfies the constraints of a type system.

Which Manning books explain type checking?

Secrets of the JavaScript Ninja, Third Edition, Kotlin in Action, 2E, The Quick Python Book, Fourth Edition, Type-Driven Development with Idris, Essential TypeScript 5, Third Edition, Julia as a Second Language and Refactoring to Rust.

What should I know before learning type checking?

Manning books that teach type checking usually introduce inheritance, Python, enum and Java first.

What is the difference between type checking and any type?

Type checking is the process of determining whether a value or program construct satisfies the constraints of a type system. The any type is a TypeScript type that permits values to be treated as having essentially any type, largely disabling static type checking for them.

What is type checking also called?

Type checking is also called type checks.

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.