# Dave Leeds on Kotlin - typealias.com

Recent content about Kotlin programming on typealias.com

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Coroutine Essentials

DevFeed: [Coroutine Essentials](<https://devfeed.tech/articles/coroutine-essentials-25051.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-coroutines/>)

Author: author@typealias.com (Dave Leeds)

Published: 2026-08-21T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [cancellation](<https://devfeed.tech/tags/cancellation.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [deferred](<https://devfeed.tech/tags/deferred.md>), [dispatcher](<https://devfeed.tech/tags/dispatcher.md>), [essentials](<https://devfeed.tech/tags/essentials.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [job](<https://devfeed.tech/tags/job.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [launch](<https://devfeed.tech/tags/launch.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [programming](<https://devfeed.tech/tags/programming.md>), [runblocking](<https://devfeed.tech/tags/runblocking.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>), [suspend-function](<https://devfeed.tech/tags/suspend-function.md>), [withcontext](<https://devfeed.tech/tags/withcontext.md>), [yield](<https://devfeed.tech/tags/yield.md>)

### AI overview

The excerpt introduces Kotlin coroutines as a way to handle multiple activities, such as network calls, while updating a screen. Its construction example shows Bot-1 ordering windows and doors sequentially, waiting idly for each delivery before starting another task. The passage sets up this inefficient timeline but ends before explaining how coroutines change it.

### Source excerpt

When you're on hold during a phone call, you might also check your email. While brewing coffee, you might also cook breakfast. And while driving a car, you might listen to a podcast. In the same way, sometimes it's helpful for the software that we write to do more than one thing at a time. For example, it could make two or three network calls at one time--all while updating the screen to show the progress of each call.

## How to Prevent Race Conditions in Coroutines

DevFeed: [How to Prevent Race Conditions in Coroutines](<https://devfeed.tech/articles/how-to-prevent-race-conditions-in-coroutines-25006.md>)

Original publisher: [Read original article](<https://typealias.com/articles/prevent-race-conditions-in-coroutines/>)

Author: author@typealias.com (Dave Leeds)

Published: 2025-11-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [actor](<https://devfeed.tech/tags/actor.md>), [atomicint](<https://devfeed.tech/tags/atomicint.md>), [atomics](<https://devfeed.tech/tags/atomics.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [limitedparallelism](<https://devfeed.tech/tags/limitedparallelism.md>), [mutex](<https://devfeed.tech/tags/mutex.md>), [programming](<https://devfeed.tech/tags/programming.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [shared-mutable-state](<https://devfeed.tech/tags/shared-mutable-state.md>), [state](<https://devfeed.tech/tags/state.md>), [stateflow](<https://devfeed.tech/tags/stateflow.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>)

### AI overview

This tutorial explains that Kotlin coroutines and structured concurrency do not automatically protect shared mutable state from race conditions. It introduces the issue using an example that creates 100,000 random bakery orders.

### Source excerpt

Thanks to structured concurrency, there are a lot of concerns that we don't have to handle manually when working with Kotlin coroutines. For example, parent coroutines automatically wait for their children to complete before completing themselves. And when a parent coroutine is cancelled, its children are automatically cancelled, too. But when it comes to shared mutable state - mutable data that multiple coroutines could update at the same time - there's nothing magical in the design of coroutines to ensure that the state is updated properly.

## Generic Variance

DevFeed: [Generic Variance](<https://devfeed.tech/articles/generic-variance-25066.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-variance/>)

Author: author@typealias.com (Dave Leeds)

Published: 2024-04-23T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Generic Variance](<https://devfeed.tech/topics/generic-variance.md>), [Contravariance](<https://devfeed.tech/topics/contravariance.md>), [interface](<https://devfeed.tech/topics/interface.md>), [subtype](<https://devfeed.tech/topics/subtype.md>)

Tags: [advanced-kotlin-concepts](<https://devfeed.tech/tags/advanced-kotlin-concepts.md>), [arguments](<https://devfeed.tech/tags/arguments.md>), [base](<https://devfeed.tech/tags/base.md>), [classes](<https://devfeed.tech/tags/classes.md>), [contravariance](<https://devfeed.tech/tags/contravariance.md>), [covariance](<https://devfeed.tech/tags/covariance.md>), [extend](<https://devfeed.tech/tags/extend.md>), [generic](<https://devfeed.tech/tags/generic.md>), [generic-variance](<https://devfeed.tech/tags/generic-variance.md>), [generics](<https://devfeed.tech/tags/generics.md>), [implement](<https://devfeed.tech/tags/implement.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-generics](<https://devfeed.tech/tags/kotlin-generics.md>), [kotlin-type-safety](<https://devfeed.tech/tags/kotlin-type-safety.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-language-type-systems](<https://devfeed.tech/tags/programming-language-type-systems.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [subtyping-in-kotlin](<https://devfeed.tech/tags/subtyping-in-kotlin.md>), [type](<https://devfeed.tech/tags/type.md>), [type-parameters](<https://devfeed.tech/tags/type-parameters.md>), [types](<https://devfeed.tech/tags/types.md>), [variance](<https://devfeed.tech/tags/variance.md>)

### AI overview

The excerpt introduces Kotlin generic variance: a parameterized type is not automatically a subtype just because its type argument is. Its vending-machine example illustrates covariance: a machine contractually returning any snack can be replaced by one that returns only candy bars, since a candy bar is a snack. The excerpt cuts off during the example and does not provide the promised three rules or discuss contravariance in detail.

### Source excerpt

We've seen how we can implement interfaces and extend classes to create subtypes. However, with generic types, we sometimes want to create a subtype based on the type arguments instead of the base types. Kotlin gives us a few different tools to achieve this, and in this chapter we'll learn all about them. In order to understand how this is possible, we'll first need to understand the principles of variance. Then, we'll look at three simple rules that explain when one parameterized type can be the subtype of another.

## Handling Runtime Exceptions

DevFeed: [Handling Runtime Exceptions](<https://devfeed.tech/articles/handling-runtime-exceptions-25055.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-exceptions/>)

Author: author@typealias.com (Dave Leeds)

Published: 2024-02-28T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Exception](<https://devfeed.tech/topics/exception.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>)

Tags: [compile](<https://devfeed.tech/tags/compile.md>), [custom-exceptions](<https://devfeed.tech/tags/custom-exceptions.md>), [errors](<https://devfeed.tech/tags/errors.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [exception-types-in-kotlin](<https://devfeed.tech/tags/exception-types-in-kotlin.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [handling](<https://devfeed.tech/tags/handling.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-programming](<https://devfeed.tech/tags/kotlin-programming.md>), [kotlin-throw-keyword](<https://devfeed.tech/tags/kotlin-throw-keyword.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [problems](<https://devfeed.tech/tags/problems.md>), [programming](<https://devfeed.tech/tags/programming.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [runtime-errors](<https://devfeed.tech/tags/runtime-errors.md>), [try-catch-blocks](<https://devfeed.tech/tags/try-catch-blocks.md>)

### AI overview

Kotlin programs can encounter problems at runtime that the compiler cannot detect in advance. The excerpt introduces exceptions as unexpected events that disrupt a function's intended plan and says the chapter will cover handling them; it begins an ordinal-conversion example but does not include its details.

### Source excerpt

In real life, when we decide to do something, we primarily think in terms of a successful experience. For example, if you're driving to your friend's house for dinner, you might look up the directions on a mapping app, make sure you've got enough gasoline in the car, and leave at the right time in order to arrive when dinner is hot. If everything goes according to plan, you'll arrive on time.

## Sealed Types

DevFeed: [Sealed Types](<https://devfeed.tech/articles/sealed-types-25064.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-sealed-types/>)

Author: author@typealias.com (Dave Leeds)

Published: 2024-01-16T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [sealed interface](<https://devfeed.tech/topics/sealed-interface.md>), [interface](<https://devfeed.tech/topics/interface.md>), [Programming Language Type Systems](<https://devfeed.tech/topics/programming-language-type-systems.md>), [enum](<https://devfeed.tech/topics/enum.md>)

Tags: [classes](<https://devfeed.tech/tags/classes.md>), [enum](<https://devfeed.tech/tags/enum.md>), [enum-class](<https://devfeed.tech/tags/enum-class.md>), [exhaustive](<https://devfeed.tech/tags/exhaustive.md>), [exhaustive-matching](<https://devfeed.tech/tags/exhaustive-matching.md>), [ice-cubes](<https://devfeed.tech/tags/ice-cubes.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-class](<https://devfeed.tech/tags/sealed-class.md>), [sealed-interface](<https://devfeed.tech/tags/sealed-interface.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [types](<https://devfeed.tech/tags/types.md>), [when-conditional](<https://devfeed.tech/tags/when-conditional.md>)

### AI overview

Sealed interfaces and classes let Kotlin limit the possible types in a hierarchy, much as enum classes limit possible values, so Kotlin can check that a when expression accounts for every case. The excerpt introduces Cecil's Ice Shop, where customers request orders or refunds and the owner models the operation in Kotlin; it notes that package sizes are initially represented by an enum class, but does not show the sealed-type implementation.

### Source excerpt

In Chapter 5, we saw how limiting our options can be a good thing. In that chapter, we used enum classes to limit our values, which allows Kotlin to ensure that we account for all possibilities in a when expression. We can get a similar benefit for our types by using sealed interfaces and classes. In this chapter, we'll visit Cecil's Ice Shop to learn all about sealed types. Let's get started!

## Data Classes and Destructuring

DevFeed: [Data Classes and Destructuring](<https://devfeed.tech/articles/data-classes-and-destructuring-25052.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-data-classes-and-destructuring/>)

Author: author@typealias.com (Dave Leeds)

Published: 2023-10-09T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [class](<https://devfeed.tech/topics/class.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [copy](<https://devfeed.tech/tags/copy.md>), [data](<https://devfeed.tech/tags/data.md>), [data-class](<https://devfeed.tech/tags/data-class.md>), [destructuring](<https://devfeed.tech/tags/destructuring.md>), [destructuring-assignment](<https://devfeed.tech/tags/destructuring-assignment.md>), [equals](<https://devfeed.tech/tags/equals.md>), [functions](<https://devfeed.tech/tags/functions.md>), [hashcode](<https://devfeed.tech/tags/hashcode.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [object](<https://devfeed.tech/tags/object.md>), [open](<https://devfeed.tech/tags/open.md>), [open-class](<https://devfeed.tech/tags/open-class.md>), [operator](<https://devfeed.tech/tags/operator.md>), [override](<https://devfeed.tech/tags/override.md>), [programming](<https://devfeed.tech/tags/programming.md>), [properties](<https://devfeed.tech/tags/properties.md>), [reference](<https://devfeed.tech/tags/reference.md>), [tostring](<https://devfeed.tech/tags/tostring.md>)

### AI overview

The excerpt introduces Kotlin data classes as useful for immutable classes that mainly hold properties, then begins with the distinction between objects that share a name and the exact instance being checked. It sets up two separate `Fiona` objects to explain reference equality using Kotlin's equality operator (`==`). The excerpt does not show the promised discussion of overriding `equals()`, `hashCode()`, or `toString()`, nor destructuring.

### Source excerpt

At the end of the last chapter, we saw how all objects in Kotlin inherit three functions from an open class called Any. Those functions are equals(), hashCode(), and toString(). In this chapter, we're going to learn about data classes, which are super-powered classes that are especially helpful when we've got an immutable class that mainly just holds properties. To better understand data classes, let's first explore each of the three functions above, and see what's involved when we override them!

## Introduction to Class Delegation

DevFeed: [Introduction to Class Delegation](<https://devfeed.tech/articles/introduction-to-class-delegation-25053.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-delegation/>)

Author: author@typealias.com (Dave Leeds)

Published: 2023-02-06T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [class](<https://devfeed.tech/topics/class.md>), [interface](<https://devfeed.tech/topics/interface.md>)

Tags: [delegation](<https://devfeed.tech/tags/delegation.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [override](<https://devfeed.tech/tags/override.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

Kotlin class delegation lets an object reuse functions and properties through interfaces by handing requests to another object when needed. The excerpt illustrates the pattern with a waiter: the waiter handles a soda order directly, but passes entrée preparation to the chef and delivers the result to the customer. The customer interacts only with the waiter, who acts on their behalf. The excerpt introduces this idea and manual delegation, but ends before showing the Kotlin implementation.

### Source excerpt

Back in Chapter 2, we introduced functions as a way to prevent us from duplicating expressions. Once we start working with classes, we might notice that it's also possible to end up duplicating our functions. There are lots of ways to reuse our functions instead of duplicating them. In this chapter, we'll see how we can use interfaces with Kotlin's class delegation feature to reuse the code from our functions and properties.

## Introduction to Interfaces

DevFeed: [Introduction to Interfaces](<https://devfeed.tech/articles/introduction-to-interfaces-25058.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-interfaces/>)

Author: author@typealias.com (Dave Leeds)

Published: 2022-09-12T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [interface](<https://devfeed.tech/topics/interface.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [superclass](<https://devfeed.tech/topics/superclass.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [cast](<https://devfeed.tech/tags/cast.md>), [classes](<https://devfeed.tech/tags/classes.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [safe-cast](<https://devfeed.tech/tags/safe-cast.md>), [smart-cast](<https://devfeed.tech/tags/smart-cast.md>), [unsafe-cast](<https://devfeed.tech/tags/unsafe-cast.md>)

### AI overview

The excerpt introduces Kotlin interfaces as a way for one object to have more than one type. It begins illustrating the topic with a farm scenario: Farmer Sue greets her chicken Henrietta, who clucks back; the excerpt ends before showing the Kotlin implementation.

### Source excerpt

Ever since Chapter 1, we've used a variety of built-in Kotlin types, like Int, String, and Boolean. Then in Chapter 4, we introduced our own custom types, like Circle, by writing classes. In this chapter, we'll dive into interfaces, which allow you to declare that a single object has more than one type at a time! Interfaces are a powerful language feature, and when used well, they can take your code to the next level.

## Scopes and Scope Functions

DevFeed: [Scopes and Scope Functions](<https://devfeed.tech/articles/scopes-and-scope-functions-25063.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-scopes-and-scope-functions/>)

Author: author@typealias.com (Dave Leeds)

Published: 2022-08-22T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [scope function](<https://devfeed.tech/topics/scope-function.md>)

Tags: [also](<https://devfeed.tech/tags/also.md>), [apply](<https://devfeed.tech/tags/apply.md>), [extension](<https://devfeed.tech/tags/extension.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [let](<https://devfeed.tech/tags/let.md>), [programming](<https://devfeed.tech/tags/programming.md>), [run](<https://devfeed.tech/tags/run.md>), [scope](<https://devfeed.tech/tags/scope.md>), [scope-function](<https://devfeed.tech/tags/scope-function.md>), [scope-functions](<https://devfeed.tech/tags/scope-functions.md>), [shadowing](<https://devfeed.tech/tags/shadowing.md>), [variables](<https://devfeed.tech/tags/variables.md>), [visibility](<https://devfeed.tech/tags/visibility.md>), [with](<https://devfeed.tech/tags/with.md>)

### AI overview

The excerpt introduces Kotlin scopes as sections of code where variables, functions, classes, and other declarations can be made. Even a variable added to a new Kotlin file belongs to that file's scope. It sets up a later discussion of the five scope functions in Kotlin's standard library but does not describe how those functions work.

### Source excerpt

In the last chapter, we learned how to create extension functions, which can be called using dot notation. In this chapter, we'll learn about scope functions, which are five particular functions that Kotlin gives us in its standard library. Before we can understand scope functions, though, it helps to first understand scopes. Introduction to Scopes In Kotlin, a scope is a section of code where we can declare new variables, functions, classes, and more.

## Receivers and Extensions

DevFeed: [Receivers and Extensions](<https://devfeed.tech/articles/receivers-and-extensions-25062.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-receivers-and-extensions/>)

Author: author@typealias.com (Dave Leeds)

Published: 2022-06-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Extension](<https://devfeed.tech/topics/extension.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [explicit-receiver](<https://devfeed.tech/tags/explicit-receiver.md>), [extension](<https://devfeed.tech/tags/extension.md>), [extension-function](<https://devfeed.tech/tags/extension-function.md>), [extension-property](<https://devfeed.tech/tags/extension-property.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [implicit-receiver](<https://devfeed.tech/tags/implicit-receiver.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [receiver](<https://devfeed.tech/tags/receiver.md>)

### AI overview

A Kotlin tutorial chapter explaining how extensions add functions and properties to existing classes. It introduces explicit and implicit receivers, extension functions, and extension properties.

### Source excerpt

Kotlin extensions can be used to add new functions and properties to existing classes--even to classes that you didn't write! In this chapter, we'll cover explicit receivers, implicit receivers, extension functions, and extension properties. Buckle up! Standalone Functions and Object Functions Way back in Chapter 2, we learned how to create functions. Here's a very simple function that puts single quotes at the beginning and the end of a String.

## Collections: Maps

DevFeed: [Collections: Maps](<https://devfeed.tech/articles/collections-maps-25060.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-maps/>)

Author: author@typealias.com (Dave Leeds)

Published: 2022-05-04T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Collections](<https://devfeed.tech/topics/collections.md>)

Tags: [associate](<https://devfeed.tech/tags/associate.md>), [association](<https://devfeed.tech/tags/association.md>), [collections](<https://devfeed.tech/tags/collections.md>), [groupby](<https://devfeed.tech/tags/groupby.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [map](<https://devfeed.tech/tags/map.md>), [maps](<https://devfeed.tech/tags/maps.md>), [pair](<https://devfeed.tech/tags/pair.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

The excerpt introduces Kotlin maps as collections that hold associations between values, like a table mapping hardware to the tool used for it (for example, a nail to a hammer). It begins showing how to represent one association with a class whose constructor takes two objects of any types, but the class name is omitted in the supplied text.

### Source excerpt

In the last chapter, we saw how collections, such as lists and sets, can be used to do things that couldn't be done easily with separate, individual variables. In this chapter, we're going to look at another kind of collection--a map, which can hold many associations between values. Let's check it out! The Right Tool for the Job "You gotta use the right tool for the job." That's what Mr. Patchwell taught his young son, Jack, who was just starting to learn how to become a handyman like his old man.

## Lambdas and Function References

DevFeed: [Lambdas and Function References](<https://devfeed.tech/articles/lambdas-and-function-references-25059.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-lambdas/>)

Author: author@typealias.com (Dave Leeds)

Published: 2022-02-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [code](<https://devfeed.tech/tags/code.md>), [function](<https://devfeed.tech/tags/function.md>), [function-reference](<https://devfeed.tech/tags/function-reference.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

A tutorial introduction to Kotlin lambdas, function types, and function references, using a barber-shop pricing example involving coupons and tax.

### Source excerpt

As we've seen, functions are a basic building block of Kotlin code. Throughout this book, we've written a lot of them, all using the fun keyword. Kotlin also gives us another way to write functions--lambdas! To help us learn about function types, function references, and lambdas, we'll need to pay a visit to Bert's Snips & Clips. Bert's Snips & Clips Bert's Snips & Clips is the barber shop to go to for a clean haircut and a nice smooth shave.

## Nulls and Null Safety

DevFeed: [Nulls and Null Safety](<https://devfeed.tech/articles/nulls-and-null-safety-25061.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-nulls/>)

Author: author@typealias.com (Dave Leeds)

Published: 2021-03-30T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Null-Safety](<https://devfeed.tech/topics/null-safety.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [elvis-operator](<https://devfeed.tech/tags/elvis-operator.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [not-null-assertion-operator](<https://devfeed.tech/tags/not-null-assertion-operator.md>), [null](<https://devfeed.tech/tags/null.md>), [null-safety](<https://devfeed.tech/tags/null-safety.md>), [nulls](<https://devfeed.tech/tags/nulls.md>), [optional](<https://devfeed.tech/tags/optional.md>), [program](<https://devfeed.tech/tags/program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [safe-call-operator](<https://devfeed.tech/tags/safe-call-operator.md>), [smart-cast](<https://devfeed.tech/tags/smart-cast.md>), [value](<https://devfeed.tech/tags/value.md>), [variable](<https://devfeed.tech/tags/variable.md>)

### AI overview

The excerpt introduces nulls as a way for a variable to hold no value, unlike the previously shown String, Int, and Boolean variables that were assigned values. It begins an example in which James collects coffee ratings and wants to track them in a Kotlin program; the excerpt ends before showing the class or explaining null safety.

### Source excerpt

So far in this book, every time that we created a variable, whether it was a String, an Int, or a Boolean, we assigned a value to it. There are times, though, when we need to create a variable that might not actually hold a value! This brings us to the exciting topic of nulls! Introduction to Nulls James has set up a coffee stand downtown, and he's ready to start sharing his fine brew!

## Enum Classes in Kotlin

DevFeed: [Enum Classes in Kotlin](<https://devfeed.tech/articles/enum-classes-in-kotlin-25054.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-enum-classes/>)

Author: author@typealias.com (Dave Leeds)

Published: 2020-10-19T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [enum](<https://devfeed.tech/topics/enum.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [classes](<https://devfeed.tech/tags/classes.md>), [enum](<https://devfeed.tech/tags/enum.md>), [enum-class](<https://devfeed.tech/tags/enum-class.md>), [enumeration](<https://devfeed.tech/tags/enumeration.md>), [feature](<https://devfeed.tech/tags/feature.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kind](<https://devfeed.tech/tags/kind.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [let-s](<https://devfeed.tech/tags/let-s.md>), [name](<https://devfeed.tech/tags/name.md>), [number](<https://devfeed.tech/tags/number.md>), [programming](<https://devfeed.tech/tags/programming.md>), [useful](<https://devfeed.tech/tags/useful.md>), [values](<https://devfeed.tech/tags/values.md>), [variable](<https://devfeed.tech/tags/variable.md>)

### AI overview

The excerpt introduces Kotlin enum classes as a way to represent a limited number of values. It begins a Schnauzer-themed example by setting up a variable to hold a pet's name, but provides no further details about the enum's definition or use.

### Source excerpt

In the last chapter, we created our very own type, called Circle, using a feature in Kotlin called a class. In this chapter, we're going to look at a special kind of class--an enum class--which is particularly useful when we want to represent a limited number of values. I hope you like Schnauzers, because this chapter is full of them! Limiting the Values Schnauzers are amazing dogs--they're smart, they're loyal to their owners, and they seem to have an opinion about everything!

## Examples of Classes in Kotlin

DevFeed: [Examples of Classes in Kotlin](<https://devfeed.tech/articles/examples-of-classes-in-kotlin-25009.md>)

Original publisher: [Read original article](<https://typealias.com/concepts/class/>)

Author: author@typealias.com (Dave Leeds)

Published: 2020-08-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [allows](<https://devfeed.tech/tags/allows.md>), [article](<https://devfeed.tech/tags/article.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [examples](<https://devfeed.tech/tags/examples.md>), [function](<https://devfeed.tech/tags/function.md>), [functions](<https://devfeed.tech/tags/functions.md>), [generic](<https://devfeed.tech/tags/generic.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [language](<https://devfeed.tech/tags/language.md>), [programming](<https://devfeed.tech/tags/programming.md>), [properties](<https://devfeed.tech/tags/properties.md>), [property](<https://devfeed.tech/tags/property.md>), [reference](<https://devfeed.tech/tags/reference.md>), [shows](<https://devfeed.tech/tags/shows.md>), [simple](<https://devfeed.tech/tags/simple.md>), [variables](<https://devfeed.tech/tags/variables.md>), [visibility-modifier](<https://devfeed.tech/tags/visibility-modifier.md>)

### AI overview

The excerpt introduces Kotlin classes as units that combine variables and functions, and presents the article as a quick reference for creating them. It says the article will show a simple class with no properties or functions, but the actual example is not included in the supplied text.

### Source excerpt

One core concept in Kotlin is a class, which allows you to combine variables and functions into a single unit. This article is a quick reference that shows how to create classes in Kotlin. There's also a full article called Introduction to Classes and Objects, which is a gentle introduction to these concepts, so if you're new to the language, you might want to start there! A Simple Class For a class that has no properties or functions, you can create a class in Kotlin with very little code:

## Introduction to Classes and Objects

DevFeed: [Introduction to Classes and Objects](<https://devfeed.tech/articles/introduction-to-classes-and-objects-25048.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-classes-and-objects/>)

Author: author@typealias.com (Dave Leeds)

Published: 2020-06-29T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [area](<https://devfeed.tech/tags/area.md>), [circle](<https://devfeed.tech/tags/circle.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [function](<https://devfeed.tech/tags/function.md>), [functions](<https://devfeed.tech/tags/functions.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [object](<https://devfeed.tech/tags/object.md>), [programming](<https://devfeed.tech/tags/programming.md>), [property](<https://devfeed.tech/tags/property.md>), [radius](<https://devfeed.tech/tags/radius.md>), [type](<https://devfeed.tech/tags/type.md>), [types](<https://devfeed.tech/tags/types.md>), [variable](<https://devfeed.tech/tags/variable.md>), [variables](<https://devfeed.tech/tags/variables.md>), [visibility-modifier](<https://devfeed.tech/tags/visibility-modifier.md>)

### AI overview

The excerpt introduces Kotlin classes as a way to define new types by grouping related variables and functions. Using a circle as the example, it explains that keeping radius, circumference, and calculation functions separate becomes harder to manage as more properties, operations, and shapes are added. It begins building a Circle class step by step, starting with an empty class; the excerpt does not provide the later implementation details.

### Source excerpt

In Chapter 1, we learned about a variety of types in Kotlin, such as Double, String, and Boolean. Get ready, because in this chapter, we're going to start creating our very own types! We'll put variables and functions together into a class. Let's get started! Putting Variables and Functions Together As you might recall, we started off this book by creating variables to hold things pertaining to a circle, such as its radius and circumference.

## Kotlin Conditionals: When and If

DevFeed: [Kotlin Conditionals: When and If](<https://devfeed.tech/articles/kotlin-conditionals-when-and-if-25050.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-conditionals/>)

Author: author@typealias.com (Dave Leeds)

Published: 2020-05-05T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [conditionals](<https://devfeed.tech/topics/conditionals.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [conditionals](<https://devfeed.tech/tags/conditionals.md>), [if-expression](<https://devfeed.tech/tags/if-expression.md>), [if-statement](<https://devfeed.tech/tags/if-statement.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [when-expression](<https://devfeed.tech/tags/when-expression.md>)

### AI overview

Kotlin conditionals choose which branch of code runs based on a condition, creating different possible execution paths. The excerpt illustrates this with Goldilocks' response to porridge temperature: above 60°C is "too hot," below 50°C is "too cold," and temperatures in between are "just right." It introduces conditionals but ends before explaining their Kotlin syntax.

### Source excerpt

In real life, we do different things depending on the circumstances. For example, if it's raining outside, you'll probably grab an umbrella. If it's sunny outside, you might grab your sunglasses. We do different things depending on the weather. Similarly, we often need our code to do different things in different situations, so in this chapter, we'll look at Kotlin's conditionals. Goldilocks and the Three Branches You might have heard the fairy tale of Goldilocks and the Three Bears.

## Functions

DevFeed: [Functions](<https://devfeed.tech/articles/functions-25056.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-functions/>)

Author: author@typealias.com (Dave Leeds)

Published: 2020-04-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Functional programming](<https://devfeed.tech/topics/functional-programming.md>)

Tags: [argument](<https://devfeed.tech/tags/argument.md>), [circle](<https://devfeed.tech/tags/circle.md>), [function](<https://devfeed.tech/tags/function.md>), [functions](<https://devfeed.tech/tags/functions.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [parameter](<https://devfeed.tech/tags/parameter.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

The chapter introduces Kotlin functions as a way to calculate the circumference of circles of different sizes without repeating the same code. The excerpt does not explain how to define or call a function.

### Source excerpt

In the last chapter, we wrote some Kotlin code to calculate the circumference of individual circles. Once we start calculating the circumference of many circles of different sizes, we can easily end up writing the same code over and over again. In this chapter, we're going to write functions, which will make it easy to calculate the circumference of any circle--without repeating ourselves! Introduction to Functions In the last chapter, we saw that it's easy to calculate the circumference of a circle.

## Variables, Expressions, and Types

DevFeed: [Variables, Expressions, and Types](<https://devfeed.tech/articles/variables-expressions-and-types-25065.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-variables-expressions-types/>)

Author: author@typealias.com (Dave Leeds)

Published: 2020-03-05T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [identifier](<https://devfeed.tech/topics/identifier.md>), [Programming Language Type Systems](<https://devfeed.tech/topics/programming-language-type-systems.md>)

Tags: [developer](<https://devfeed.tech/tags/developer.md>), [expression](<https://devfeed.tech/tags/expression.md>), [fundamentals](<https://devfeed.tech/tags/fundamentals.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [statement](<https://devfeed.tech/tags/statement.md>), [types](<https://devfeed.tech/tags/types.md>), [val](<https://devfeed.tech/tags/val.md>), [var](<https://devfeed.tech/tags/var.md>), [variable](<https://devfeed.tech/tags/variable.md>), [variables](<https://devfeed.tech/tags/variables.md>)

### AI overview

The excerpt introduces Kotlin variables as named holders for values, using a circle's radius in the circumference formula as an analogy: the radius can vary, and a variable can hold a number or other things. It frames variables, expressions, and types as the first chapter's fundamentals, but ends before giving the promised Kotlin code example.

### Source excerpt

So you want to be a Kotlin developer? You've come to the right place! This book will take you through the fundamentals of Kotlin, gently introducing you to the most important concepts of the language in order to help you become a proficient Kotlin developer. Even if you're a seasoned professional, it's important to know the fundamentals in order to establish a solid foundation of understanding so that you can be as effective as possible.

## When to Use Sequences

DevFeed: [When to Use Sequences](<https://devfeed.tech/articles/when-to-use-sequences-25045.md>)

Original publisher: [Read original article](<https://typealias.com/guides/when-to-use-sequences/>)

Author: author@typealias.com (Dave Leeds)

Published: 2019-09-16T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Sequences](<https://devfeed.tech/topics/sequences.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [collections](<https://devfeed.tech/tags/collections.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [performance](<https://devfeed.tech/tags/performance.md>), [programming](<https://devfeed.tech/tags/programming.md>), [sequences](<https://devfeed.tech/tags/sequences.md>), [stateful](<https://devfeed.tech/tags/stateful.md>), [stateless](<https://devfeed.tech/tags/stateless.md>)

### AI overview

Kotlin sequences can avoid the intermediate collections created between operations in a standard collection chain, so chains with many operations may favor sequences. Collections can still be more efficient in some cases; performance depends on multiple interacting factors, and the excerpt emphasizes benchmarking with representative data to know for sure. The excerpt introduces a comparison with Java streams but does not provide its findings.

### Source excerpt

One of the most common questions I get about Kotlin's sequences is this: "When should I use sequences, and when should I use normal collections?" That's the question we're going to answer in this third and final article in this series! We're going to look at the trade-offs of each, including the main things that affect their performance. Then, we'll look at how Kotlin's sequences stack up against Java streams, a similar concept.

## Inside Sequences: Create Your Own Sequence Operations

DevFeed: [Inside Sequences: Create Your Own Sequence Operations](<https://devfeed.tech/articles/inside-sequences-create-your-own-sequence-operations-25038.md>)

Original publisher: [Read original article](<https://typealias.com/guides/inside-kotlin-sequences/>)

Author: author@typealias.com (Dave Leeds)

Published: 2019-07-23T05:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Sequences](<https://devfeed.tech/topics/sequences.md>)

Tags: [collection-operations](<https://devfeed.tech/tags/collection-operations.md>), [collections](<https://devfeed.tech/tags/collections.md>), [intermediate](<https://devfeed.tech/tags/intermediate.md>), [iterable](<https://devfeed.tech/tags/iterable.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [operations](<https://devfeed.tech/tags/operations.md>), [performance](<https://devfeed.tech/tags/performance.md>), [programming](<https://devfeed.tech/tags/programming.md>), [sequences](<https://devfeed.tech/tags/sequences.md>), [terminal](<https://devfeed.tech/tags/terminal.md>)

### AI overview

Kotlin sequences apply each applicable operation to one element before moving to the next, while collection chains apply each operation across all elements before starting the next. The excerpt connects this behavior to iteration and explains that sequence operation chains compose by wrapping one sequence in another; sequence classes are named for the operations they perform. It introduces a custom Sequence implementation, but the excerpt ends before showing how it is built.

### Source excerpt

Sequences are a fantastic way to process collections of data in a way that can perform better than the standard collection operations, as we saw in the previous article, Kotlin Sequences: An Illustrated Guide. Today, we're going even deeper! We're going to look under the hood - inside Kotlin sequences - in order to understand how they work like never before! In fact, by the end of this article, we'll even create our very own Sequence class and plug it into an operation chain!

## Kotlin Sequences: An Illustrated Guide

DevFeed: [Kotlin Sequences: An Illustrated Guide](<https://devfeed.tech/articles/kotlin-sequences-an-illustrated-guide-25041.md>)

Original publisher: [Read original article](<https://typealias.com/guides/kotlin-sequences-illustrated-guide/>)

Author: author@typealias.com (Dave Leeds)

Published: 2019-03-07T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Sequences](<https://devfeed.tech/topics/sequences.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [coding](<https://devfeed.tech/tags/coding.md>), [collect](<https://devfeed.tech/tags/collect.md>), [collection-operations](<https://devfeed.tech/tags/collection-operations.md>), [collections](<https://devfeed.tech/tags/collections.md>), [color](<https://devfeed.tech/tags/color.md>), [colors](<https://devfeed.tech/tags/colors.md>), [demand](<https://devfeed.tech/tags/demand.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [factory](<https://devfeed.tech/tags/factory.md>), [faster](<https://devfeed.tech/tags/faster.md>), [filter](<https://devfeed.tech/tags/filter.md>), [fire](<https://devfeed.tech/tags/fire.md>), [first](<https://devfeed.tech/tags/first.md>), [flow](<https://devfeed.tech/tags/flow.md>), [guide](<https://devfeed.tech/tags/guide.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [process](<https://devfeed.tech/tags/process.md>), [programming](<https://devfeed.tech/tags/programming.md>), [sequences](<https://devfeed.tech/tags/sequences.md>)

### AI overview

The excerpt frames Kotlin sequences against normal collections through a crayon-factory example. To make a five-crayon Fire Crayon Set, the described workflow filters a large box by allowed colors, labels the remaining crayons, takes the first five, and collects them into a final box. The article says this process can be modeled with five Kotlin standard-library collection operations, but the excerpt ends before showing the code or explaining how sequences change its efficiency.

### Source excerpt

You've probably come across Kotlin's sequences at one time or another. Maybe you've heard that they can process data more efficiently than normal collections. But have you ever wondered exactly what they do, how they achieve the efficiency, or when you should use them? In this article series, we're going to cover just about everything there is to know about them! In this article, we'll walk through a story that will help us visualize the difference between sequences and normal collections.

## Inline Classes and Autoboxing

DevFeed: [Inline Classes and Autoboxing](<https://devfeed.tech/articles/inline-classes-and-autoboxing-25036.md>)

Original publisher: [Read original article](<https://typealias.com/guides/inline-classes-and-autoboxing/>)

Author: author@typealias.com (Dave Leeds)

Published: 2018-10-10T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [data type](<https://devfeed.tech/topics/data-type.md>), [class](<https://devfeed.tech/topics/class.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [classes](<https://devfeed.tech/tags/classes.md>), [game](<https://devfeed.tech/tags/game.md>), [interface](<https://devfeed.tech/tags/interface.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [native](<https://devfeed.tech/tags/native.md>), [performance](<https://devfeed.tech/tags/performance.md>), [programming](<https://devfeed.tech/tags/programming.md>), [subtype](<https://devfeed.tech/tags/subtype.md>)

### AI overview

Kotlin inline classes can improve performance by replacing instances with their underlying values, particularly for primitive types, but the benefit depends on how they are used. The excerpt focuses on JVM autoboxing and explains that inline class values are not always inlined in compiled code. In the example, an inline class implements an interface and is passed to a function accepting any object; the excerpt sets up this case as a reason performance can differ, but cuts off before showing the complete mechanism or benchmark results.

### Source excerpt

In the last article, we discovered how Kotlin's inline classes feature allows us to "create the data types that we want without giving up the performance that we need." We learned that: Inline classes wrap an underlying value. When the code is compiled, instances of the inline class get replaced with the underlying value. This can improve our app's performance, especially when the underlying type is a primitive. In some situations, though, inline classes could actually perform more slowly than traditional classes!

## An Introduction to Inline Classes

DevFeed: [An Introduction to Inline Classes](<https://devfeed.tech/articles/an-introduction-to-inline-classes-25039.md>)

Original publisher: [Read original article](<https://typealias.com/guides/introduction-to-inline-classes/>)

Author: author@typealias.com (Dave Leeds)

Published: 2018-08-28T05:00:01Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [extension property](<https://devfeed.tech/topics/extension-property.md>)

Tags: [apps](<https://devfeed.tech/tags/apps.md>), [classes](<https://devfeed.tech/tags/classes.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [code](<https://devfeed.tech/tags/code.md>), [data](<https://devfeed.tech/tags/data.md>), [data-types](<https://devfeed.tech/tags/data-types.md>), [fast](<https://devfeed.tech/tags/fast.md>), [feature](<https://devfeed.tech/tags/feature.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [performance](<https://devfeed.tech/tags/performance.md>), [phones](<https://devfeed.tech/tags/phones.md>), [processes](<https://devfeed.tech/tags/processes.md>), [programming](<https://devfeed.tech/tags/programming.md>), [series](<https://devfeed.tech/tags/series.md>), [trade](<https://devfeed.tech/tags/trade.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

Kotlin inline classes are introduced as a way to create strongly typed values without giving up performance. The excerpt motivates them with a mail scheduler that accepts an integer delay but does not reveal whether it means days, hours, minutes, seconds, or milliseconds; naming the parameter with its unit helps, but relies on developers to follow the hint. The proposed improvement is a strong type that lets the compiler enforce the expected unit. The excerpt does not explain implementation details or the trade-offs of using inline classes.

### Source excerpt

Whether you're writing massive data-chomping processes that run in the cloud, or mobile apps that run on low-powered cell phones, most of us want our code to run fast. And now, Kotlin's inline classes feature allows us to create the data types that we want without giving up the performance that we need! In this series, we're going to take a look at inline classes from top to bottom! This article explores what they are, how they work, and the trade-offs involved when choosing to use them.

[Next page](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md?cursor=WyIyMDE4LTA4LTI4VDA1OjAwOjAxKzAwOjAwIiwgIjc1YzVhYjQ2LTE1NmMtNDk5Mi04ZjRhLWQwZWU5ZTQ4MjcwYiJd>)