Mastering Kotlin standard functions: run, with, let, also and apply

Some of the Kotlin’s standard functions are so similar that we are not sure which to use. Here I will introduce a simple way to clearly distinguish their differences and how to pick which to use.

Scoping functions

The functions that I’ll focus on are run, with, T.run, T.let, T.also, and T.apply. I call them…

--

--

--

Sharing iOS, Android and relevant Mobile App Development Technology and Learning

Recommended from Medium

How to read a SQL query into a pandas DataFrame

What is the difference between JDK, JRE & JVM?

How to buy or sell stocks in a data driven way

How to get rid of a rouge instance in Azure App Service Plan

10 Best Programming habits

SERVICENOW

Software is written for People

Weekly Report Suterusu 2021 Week 28 Summary

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Elye

Elye

Sharing Software Development Experience, focus on Mobile. https://elye-project.medium.com/subscribe https://twitter.com/elye_project

More from Medium

Android Touch System — Part 2: Common Touch Event Scenarios

Saving StateFlow State in ViewModel

How To Test Kotlin Coroutines?

People creating

Kotlin Cookbook 1