Lazy comparison of Kotlin and Swift

Photo by Jeremy Bishop on Unsplash

Lazy initialization is a programming feature that all modern programming language must have. However how they are implemented differs from one to the other. Let’s compare them between Kotlin and Swift.

Declaration

Kotlin

Lazy initialization is done through the delegate by feature. And lazy is actually a function that takes in a lambda.

--

--

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