Kotlin in the Wild
290 pages
English
PDF
4.5

Kotlin in the Wild

Kotlin in the Wild

Author:

Year:

Summary:

Introduction

The book «Kotlin in the Wild» (authors — Ian Clarke and Enrico Bruno Del Zotto, 2021, 290 pages) is not another textbook on Kotlin syntax. It is a collection of real-world cases, architectural solutions, and practical techniques that the authors gathered while working on commercial projects. The name speaks for itself: Kotlin «in the wild» — that is, in the conditions of real development, with its deadlines, bugs, and non-obvious trade-offs.

The book is aimed at developers who already know the basics of Kotlin (or Java) and want to understand how to use the language in real projects — from Android applications to server-side solutions on Ktor and Spring Boot. It does not teach how to write «Hello, World», but shows how to build production-grade systems.

What the book is about

«Kotlin in the Wild» consists of 12 chapters, each dedicated to a specific aspect of Kotlin development. The authors share experience gained in companies of various sizes — from startups to large corporations. Main topics:

  • Application architecture — how to organize code to make it flexible and testable. Patterns MVVM, MVI, Clean Architecture in Kotlin are discussed.
  • Working with coroutines and Flow — not just syntax, but real scenarios: request cancellation, error handling, testing asynchronous code.
  • Serialization and working with API — using kotlinx.serialization, configuring Retrofit, processing JSON with Kotlin's null-safety in mind.
  • DI (Dependency Injection) — comparing Koin and Dagger/Hilt, when to choose what, how not to overcomplicate.
  • Testing — unit tests, integration tests, mock objects, testing coroutines. A separate chapter on TDD in Kotlin.
  • Android specifics — Jetpack Compose, Navigation, ViewModel, working with the lifecycle.
  • Backend in Kotlin — Ktor, Exposed (ORM), creating REST API, working with databases.
  • Migration from Java — how to gradually introduce Kotlin into an existing Java project, typical problems and their solutions.

Who this book is for

The book is intended for practicing developers who want to deepen their Kotlin knowledge and learn to apply it in real projects. It will be useful for:

  • Android developers transitioning from Java to Kotlin;
  • Backend developers using Kotlin on the server;
  • Team leads and architects choosing tools and approaches for their team;
  • Anyone who wants to see Kotlin not in isolation, but in conjunction with other technologies (Ktor, Exposed, Koin, Jetpack).

The book is not suitable for beginner programmers — it assumes the reader already knows how to write code and is familiar with the basics of OOP, multithreading, and working with Git.

What the reader will learn

  • How to design an application architecture in Kotlin that is easy to maintain and extend.
  • How to effectively use coroutines and Flow for asynchronous operations, avoiding common mistakes (e.g., memory leaks).
  • How to set up Dependency Injection without pain and unnecessary boilerplate.
  • How to write tests that actually verify business logic, not just increase coverage.
  • How to migrate a project from Java to Kotlin without breaking production.
  • How to build a REST API on Ktor and work with databases via Exposed.
  • How to use Jetpack Compose to create modern UIs.

Strengths of the book

  • Practical focus. Each chapter contains code examples that can be immediately applied in your own project. The authors are not afraid to show «dirty» details — for example, how to handle errors in coroutines or how to test Flow.
  • Real-world cases. The book discusses situations that developers face every day: library version conflicts, non-obvious behavior of null-safety, problems

Recommendations