Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Dave Leeds

Learn Kotlin programming the fun way, with oodles of illustrations and concrete explanations, in a book that steps through the concepts one at a time in order to help you build a solid mental model of the language. Whether you're new to Kotlin, or just looking to fill in some gaps of knowledge, Kotlin: An Illustrated Guide has got you covered! Who is this book for? If you’re interested in learning Kotlin development, this book is for you. Everyone has a unique experience - some readers are new to software development entirely, some are new to Kotlin development, and some are existing Kotlin developers who want a deeper understanding of certain language concepts. My approach in this book is to explain Kotlin programming concepts with simple, tangible, and illustrated examples, so that regardless of your experience level, things will make sense. I do my best to define terms clearly before using them, so that each chapter builds upon a solid foundation of knowledge from the previous chapters. Even if you already know some of the concepts presented in this book, my goal is to give those concepts such a fun and vivid presentation that you’ll enjoy reading about them again! I hope that will give you a definite clarity about them, shining light on the foggy corners of concepts that you might have wondered about. What’s the current state of this book? I'm actively working on the final few chapters of this book Chapters 1-19 are complete. Chapter 20 is available as a draft. When complete, this book will have 20 chapters plus some appendices. My main focus at the moment is to complete the remaining chapters. After that, I’ll plan to refine some of the artwork in earlier chapters, to give them even better resolution for the PDF format. Release Notes v0.20.a - May 17, 2024 Chapter 20: Coroutine Essentials - A draft of this chapter is now available.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Kotlin: An Illustrated Guide — Reading Guide ## 【One-Line Pitch】 A friendly, heavily illustrated walkthrough of Kotlin that builds your mental model one concept at a time — perfect for complete beginners to programming, developers new to Kotlin, or experienced Kotlin users who want to fill in gaps and finally "get" the tricky parts. --- ## 【Book Arc】 - **Opening (~0%–10%)**: The book opens with the author's philosophy — learn by building clear mental models through simple, tangible, illustrated examples. It then dives straight into fundamentals: variables, expressions, types, and functions, with an emphasis on defining every term before using it. - **Early (~10%–29%)**: Core language mechanics take center stage: enum classes, null safety (nullable types, Elvis operator, safe-call operator), lambdas and function references, and the first look at collections (lists and sets). This is where Kotlin's distinctive personality starts to shine. - **Early-to-Middle (~29%–38%)**: Collections continue with maps, then the book pivots to deeper language architecture — receivers, extension functions, and scope functions (with guidance on choosing the right one). These concepts are foundational for idiomatic Kotlin. - **Middle (~38%–52%)**: Object-oriented territory: interfaces, class delegation, abstract and open classes, and inheritance. The book then moves into data classes, copying, and destructuring — practical tools for everyday Kotlin work. - **Middle-to-Late (~52%–57%)**: Sealed types are introduced and compared against enum classes, followed by exception handling — catching, throwing, and evaluating try-catch as expressions. The final chapter (available as a draft) covers coroutine essentials. --- ## 【Key Takeaways】 - **Mental models over memorization** (Opening): The book's core promise is that every concept is explained with tangible, illustrated examples so you build genuine understanding rather than rote knowledge. This makes it uniquely accessible for true beginners. - **Null safety is a first-class language feature** (Early): Kotlin distinguishes nullable and non-nullable types at compile time, and the book walks through each tool — conditionals, the Elvis operator, the not-null assertion, and the safe-call operator — so you know exactly when to reach for which. - **Lambdas are everywhere in idiomatic Kotlin** (Early): Function types, the implicit `it` parameter, higher-order functions, and closures are introduced through a memorable narrative (Bert's Snips & Clips) that makes abstract concepts concrete. - **Collections are more than containers** (Early): Lists, sets, and maps come with rich built-in operations and iteration patterns. The book treats collection operations as a skill in themselves, not just data storage. - **Extensions and receivers unlock expressive APIs** (Early): Understanding receivers and extension functions is key to reading and writing idiomatic Kotlin — this is where the language's "DSL-friendly" nature starts to make sense. - **Scope functions need deliberate selection** (Early): With several scope functions available, the book dedicates space to choosing the right one for the situation — a practical decision-making framework rather than a list of syntax. - **Interfaces and delegation beat deep inheritance** (Middle): The book introduces interfaces, subtypes, casting, and class delegation as alternatives to traditional inheritance, showing how Kotlin encourages composition and flexibility. - **Data classes and sealed types solve real problems** (Middle): Data classes give you copying, destructuring, and sensible `toString()` out of the box; sealed types let you model closed hierarchies with compile-time safety. Both are presented with clear "when to use" guidance. --- ## 【Reading Tips】 1. **Read in order, don't skip ahead** — the author explicitly builds each chapter on the previous ones, and terms are defined before they're used. The progression from variables → functions → nulls → lambdas → collections → OO is carefully sequenced. 2. **Skim the illustrations, then read the text** — the visuals are the book's signature; let them give you the gist, then read the prose to solidify the details. 3. **Pay extra attention to the "choosing" sections** — the book includes practical guidance like "Choosing the Most Appropriate Scope Function" and comparisons like "Sealed Types vs Enum Classes." These are where the real-world decision-making lives. 4. **Expect the final chapter to be rougher** — Chapter 20 (Coroutine Essentials) is a draft, so treat it as an introduction rather than a definitive reference. 5. **If you're an experienced developer, skim the early chapters** — the fundamentals (variables, functions, types) are well-explained but will be familiar; the value for you starts around receivers, extensions, and scope functions. --- ## 【Coverage Limits】 The excerpts cover the table of contents and chapter structure through roughly 57% of the book (exception handling). The final chapters on coroutines and any appendices are only partially represented in this guide. --- ##
Excerpt 1
for the PDF format. Release Notes v0.20.a - May 17, 2024 Chapter 20: Coroutine Essentials - A draft of this chapter is now available. Kotlin: An Illustrated...
View in text
Excerpt 2
............................................................ 55 iTable of Contents Table of Contents Everything is an Object ...................................
View in text
Page 7
..........................................................................................143 Creating a Map from a List .......................................
View in text
Page 5
ce .............................................................................................................................................................
View in text
Page 5
................................................................................................................................................................
View in text
Page 11
t chapters as they’re written. • Chapters 1-19 are complete. You’re welcome to provide feedback about them. • Chapter 20, the final chapter of the book, is a...
View in text
Page 17
e, you can’t use var as the name of the variable: var r = 5.2 assignment declaration Listing 1.1 - Creating a variable in Kotlin. var r = 5.2 var r = 5.2 var...
View in text
Page 20
as our circumference equation! Let’s dive into expressions! Expressions and Statements Let’s look at that equation one more time: We’ve already created a var...
View in text
Tags
AI categories
Programmingkotlin
Publisher: TypeAlias Studios
Publish Year: 2024
Language: English
Pages: 417
File Format: PDF
File Size: 26.3 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…