What’s New - May 2022

Kotlin: An Illustrated Guide, Chapter 9 has been published! Continuing the topic of collections from the previous chapter, this one covers pairs and maps.

With Chapter 9 complete, we’re about half way through the list of chapters that I’ve got planned. Upcoming chapters will cover extensions, scopes, exceptions, abstractions, generics, coroutines, and more. Thanks so much to everyone who’s been cheering me on throughout this project!

Latest Articles

Collections: Maps

Maps in Kotlin are used to associate keys and values. In this chapter, we'll learn all about them, including mutable and immutable maps, map operations like forEach() and filter(), and how to convert lists into maps with associate() and groupBy().

Collections: Maps

Collections: Lists and Sets

Kotlin collections give you powerful control over groups of objects. In this chapter, we'll look at List and Set collection types, and we'll learn about collection operations - including mapping, filtering, and sorting.

Collections: Lists and Sets

Lambdas and Function References

In Kotlin, you can pass a chunk of code from one function to another. In this chapter, we'll learn how to do that, covering topics like function types, function references, lambdas, higher-order functions, and much more.

Lambdas and Function References

Nulls and Null Safety

In Kotlin, null safety is a first-class concept. In this chapter, we'll learn all about nulls, including how to manage them with tools like smart casts, elvis operators, safe-call operators, and more.

Nulls and Null Safety

Enum Classes in Kotlin

Enumeration classes can improve your code by limiting values to only those that could be correct. In this chapter, we'll learn all about enum classes in Kotlin!

Enum Classes in Kotlin

Examples of Classes in Kotlin

A quick reference that shows how to create classes in Kotlin, with examples that include properties, functions, inheritance, generics, and more.

Examples of Classes in Kotlin

Introduction to Classes and Objects

Classes and objects are everywhere in Kotlin! In this chapter, we'll put variables and functions together to create our very own types, using Kotlin classes.

Introduction to Classes and Objects

Kotlin Conditionals: When and If

Kotlin has two important conditionals: when and if. They can be used either as expressions or as statements. In this chapter, we'll use illustrations and examples to demonstrate how to use them.

Kotlin Conditionals: When and If

Functions

Learn all about Kotlin functions the fun and easy way, with lots of examples and illustrations! Expression bodies, block bodies, named arguments, default arguments, and lots more.

Functions

Variables, Expressions, and Types

So you want to be a Kotlin programmer? You've come to the right place! Your adventure starts here in Chapter 1, where you'll learn all about variables, expressions, and types.

Variables, Expressions, and Types

When to Use Sequences

When should you use Kotlin sequences? And when should you use normal collections? In this article, we'll look at some of the characteristics that can have the biggest impact on performance.

When to Use Sequences

Inside Sequences: Create Your Own Sequence Operations

Learn how to create your very own sequence operation by understanding how Kotlin's sequences work on the inside.

Inside Sequences: Create Your Own Sequence Operations

Kotlin Sequences: An Illustrated Guide

An illustrated introduction to Sequences in Kotlin - easy-to-understand diagrams that demonstrate the difference between regular collection operations and sequence operations.

Kotlin Sequences: An Illustrated Guide
Updated!

Inline Classes and Autoboxing (Updated for Kotlin 1.5)

Get the best performance out of Kotlin's Inline Classes feature by understanding when they're inlined and when they're autoboxed.

Inline Classes and Autoboxing (Updated for Kotlin 1.5)
Updated!

An Introduction to Inline Classes (Updated for Kotlin 1.5)

An introduction to Kotlin's inline value classes, which can give you strong types for simple values - without sacrificing performance.

An Introduction to Inline Classes (Updated for Kotlin 1.5)

How to Enable Kotlin 1.3 Inline Classes Today

How to configure your IDE to use Kotlin 1.3 early access so that you can start exploring inline classes and other new features. Includes instructions for Gradle, Maven, IntelliJ IDEA, and Android Studio.

How to Enable Kotlin 1.3 Inline Classes Today

Parameters and Arguments: An Easy Way to Remember the Difference

Parameters and arguments aren't the same thing. Here's an easy way to remember the difference.

Parameters and Arguments: An Easy Way to Remember the Difference

All About Type Aliases in Kotlin

Kotlin's type aliases give you a quick and easy way to create simple, concise, and domain-specific names for types. This guide covers all of the essential concepts, with plenty of examples to help you level up your Kotlin game.

All About Type Aliases in Kotlin

Star-Projections and How They Work

What are star-projections in Kotlin? And why do they change your function parameter and return types? With just two easy-to-understand rules, we can illuminate star-projections and understand exactly why they work like they do.

Star-Projections and How They Work

The Ins and Outs of Generic Variance in Kotlin

The ultimate guide to understanding generics, covariance, contravariance, and type projections in Kotlin. Learn two simple subtyping rules that explain why generic variance works the way that it does.

The Ins and Outs of Generic Variance in Kotlin