Programming with Types
Programming with Types
Summary:
Introduction
The book "Programming with Types" by Vlad Riscutia was published in 2019 and immediately attracted the attention of developers seeking to deepen their understanding of how the type system can improve code quality. Across 312 pages, the author reveals the power of static typing using the C# language and the .NET platform. This is not another syntax reference, but a practical guide to designing reliable, self-documenting, and easily maintainable programs.
What the book is about
The book focuses on using types as a tool to prevent errors at compile time. The author consistently guides the reader from simple concepts (basic types, casting, overloading) to complex ones (generic types, functional patterns, algebraic data types). Each chapter contains examples in C# that clearly demonstrate how choosing the right type can eliminate entire classes of bugs. Special attention is paid to practical techniques: creating type-safe APIs, using discriminated unions, working with nullable types, and pattern matching.
Who this book is for
The book is aimed at developers already familiar with the basics of C# or any other statically typed language. It will be useful for:
- programmers who want to write more reliable code without excessive testing;
- team leads and architects striving to improve the quality of their codebase;
- developers transitioning from dynamic languages (Python, JavaScript) to statically typed ones;
- anyone who wants to understand the modern capabilities of the C# type system (nullable reference types, pattern matching, records).
What the reader will learn
After reading, you will be able to:
- design types that make invalid states unrepresentable;
- use generic types to create flexible and safe components;
- apply algebraic data types (sum types, product types) for domain modeling;
- effectively work with nullable types and avoid NullReferenceException;
- use pattern matching for concise handling of various data variants;
- build call chains using functional primitives (Option, Result, Either);
- understand how the type system affects code performance and maintainability.
Strengths
The main advantage of the book is its practical focus. The author doesn't just explain theory but shows how specific techniques (for example, using the Option type instead of null) change the application architecture. The code examples are well-structured, and complex concepts (such as covariance and contravariance) are broken down using simple real-life examples. The chapter on functional patterns in C# deserves special mention — it will be useful even for experienced developers. The book is written in a lively style, without excessive academicism, making it accessible to a wide audience.
Who it is recommended for
I recommend this book to everyone who writes in C# and wants to elevate their level from "just working code" to "code that is impossible to break." It will also be useful for developers using Java, TypeScript, and other statically typed languages — the core concepts are universal. If you use Python but are considering adopting type hints and mypy, the book will provide a deep understanding of why this is necessary. "Programming with Types" is an investment in the quality of your code that will pay off many times over.